From 54edc2d5e92d8c117e116a8c507442e49d17e24e Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 11:55:30 +0200 Subject: exp: Include experiments in main distribution This change updates the Gradle configuration to include experiments in the main distribution of OpenDC. Users can directly execute the experiments from the command-line without having to recompile the entire code-base. --- .../src/main/kotlin/distribution-conventions.gradle.kts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'buildSrc/src/main/kotlin/distribution-conventions.gradle.kts') diff --git a/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts b/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts index a0b7593d..57e5b284 100644 --- a/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts @@ -39,12 +39,23 @@ distributions { from("README.md") from("LICENSE.txt") + from("docs") { into("docs") } - // Include the distributions of the sub project. + // Include distributions of the subprojects getTasksByName("assembleDist", true) .filter { it.project != project } - .map { it.project.the()["main"] } - .forEach { with(it.contents) } + .map { it.project.name to it.project.the() } + .forEach { (name, dist) -> + dist.findByName("main")?.let { with(it.contents) } + + // Include experiments if they exist + val experiment = dist.findByName("experiment") + if (experiment != null) { + into("experiments/${name.removePrefix("opendc-experiments-")}") { + with(experiment.contents) + } + } + } } } } -- cgit v1.2.3