summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/distribution-conventions.gradle.kts
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-05 11:55:30 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-05 12:12:32 +0200
commit54edc2d5e92d8c117e116a8c507442e49d17e24e (patch)
tree1f6e34c55c1289687c512097486fbee6ba9da368 /buildSrc/src/main/kotlin/distribution-conventions.gradle.kts
parentad65a05e3f41850807f95f7d643496a4d39a6197 (diff)
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.
Diffstat (limited to 'buildSrc/src/main/kotlin/distribution-conventions.gradle.kts')
-rw-r--r--buildSrc/src/main/kotlin/distribution-conventions.gradle.kts17
1 files changed, 14 insertions, 3 deletions
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<DistributionContainer>()["main"] }
- .forEach { with(it.contents) }
+ .map { it.project.name to it.project.the<DistributionContainer>() }
+ .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)
+ }
+ }
+ }
}
}
}