From a17e7eda3cfd70b033e2fb6097880fba7f5af864 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Fri, 12 Jul 2024 14:08:53 +0200 Subject: Merged experiment-scenario and experiment-base by moving ScenarioCli.kt to experiment-base. Renamed the distribution of experiment-base to OpenDCScenarioRunner (#236) --- .../opendc-experiments-base/build.gradle.kts | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'opendc-experiments/opendc-experiments-base/build.gradle.kts') diff --git a/opendc-experiments/opendc-experiments-base/build.gradle.kts b/opendc-experiments/opendc-experiments-base/build.gradle.kts index 30510785..303517aa 100644 --- a/opendc-experiments/opendc-experiments-base/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-base/build.gradle.kts @@ -27,6 +27,7 @@ plugins { `kotlin-library-conventions` `testing-conventions` `jacoco-conventions` + distribution kotlin("plugin.serialization") version "1.9.22" } @@ -35,6 +36,8 @@ dependencies { api(projects.opendcCompute.opendcComputeService) api(projects.opendcCompute.opendcComputeSimulator) + implementation(libs.clikt) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") implementation(libs.progressbar) implementation(project(mapOf("path" to ":opendc-simulator:opendc-simulator-core"))) @@ -48,3 +51,36 @@ dependencies { runtimeOnly(libs.log4j.core) runtimeOnly(libs.log4j.slf4j) } + +val createScenarioApp by tasks.creating(CreateStartScripts::class) { + dependsOn(tasks.jar) + + applicationName = "OpenDCScenarioRunner" + mainClass.set("org.opendc.experiments.base.ScenarioCLI") + classpath = tasks.jar.get().outputs.files + configurations["runtimeClasspath"] + outputDir = project.buildDir.resolve("scripts") +} + +// Create custom Scenario distribution +distributions { + main { + distributionBaseName.set("OpenDCScenarioRunner") + + contents { + from("README.md") + from("LICENSE.txt") + from("../../LICENSE.txt") { + rename { "LICENSE-OpenDC.txt" } + } + + into("bin") { + from(createScenarioApp) + } + + into("lib") { + from(tasks.jar) + from(configurations["runtimeClasspath"]) + } + } + } +} -- cgit v1.2.3