summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-base/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-experiments/opendc-experiments-base/build.gradle.kts')
-rw-r--r--opendc-experiments/opendc-experiments-base/build.gradle.kts36
1 files changed, 36 insertions, 0 deletions
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"])
+ }
+ }
+ }
+}