diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-05-06 12:54:45 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-05-06 22:13:43 +0200 |
| commit | d431cea8b220cc50c623e37be9595025125438f5 (patch) | |
| tree | 421f6cd873489ea2d8c1b887a2e3cf1592937f1e /opendc-experiments/opendc-experiments-capelin/build.gradle.kts | |
| parent | 183c29d907bc231c93ff5fe525040c931776b567 (diff) | |
refactor(exp/capelin): Add independent Capelin distribution
This change updates the Capelin experiments so it can be distributed and
executed independently of the main OpenDC distribution. We provide a new
command line interface for users to directly run the experiments.
Alternatively, the `CapelinRunner` class encapsulates the logic for
running the experiments and can be used programmatically.
Diffstat (limited to 'opendc-experiments/opendc-experiments-capelin/build.gradle.kts')
| -rw-r--r-- | opendc-experiments/opendc-experiments-capelin/build.gradle.kts | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts index 39cf101d..8320179a 100644 --- a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts @@ -24,28 +24,62 @@ description = "Experiments for the Capelin work" /* Build configuration */ plugins { - `experiment-conventions` + `kotlin-conventions` `testing-conventions` `jacoco-conventions` `benchmark-conventions` + distribution } dependencies { - api(projects.opendcHarness.opendcHarnessApi) api(projects.opendcCompute.opendcComputeWorkload) implementation(projects.opendcSimulator.opendcSimulatorCore) implementation(projects.opendcSimulator.opendcSimulatorCompute) implementation(projects.opendcCompute.opendcComputeSimulator) - implementation(libs.config) + implementation(libs.clikt) + implementation(libs.progressbar) implementation(libs.kotlin.logging) - implementation(libs.jackson.databind) - implementation(libs.jackson.module.kotlin) implementation(libs.jackson.dataformat.csv) - implementation(kotlin("reflect")) runtimeOnly(projects.opendcTrace.opendcTraceOpendc) + runtimeOnly(libs.log4j.slf4j) +} + +val createCapelinApp by tasks.creating(CreateStartScripts::class) { + dependsOn(tasks.jar) + + applicationName = "capelin" + mainClass.set("org.opendc.experiments.capelin.CapelinCli") + classpath = tasks.jar.get().outputs.files + configurations["runtimeClasspath"] + outputDir = project.buildDir.resolve("scripts") +} + +/* Create custom Capelin distribution */ +distributions { + main { + distributionBaseName.set("capelin") + + contents { + from("README.md") + from("LICENSE.txt") + from("../../LICENSE.txt") { + rename { "LICENSE-OpenDC.txt" } + } + + into("bin") { + from(createCapelinApp) + } + + into("lib") { + from(tasks.jar) + from(configurations["runtimeClasspath"]) + } - testImplementation(libs.log4j.slf4j) + into("input") { + from("input") + } + } + } } |
