summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/experiment-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/experiment-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/experiment-conventions.gradle.kts')
-rw-r--r--buildSrc/src/main/kotlin/experiment-conventions.gradle.kts22
1 files changed, 21 insertions, 1 deletions
diff --git a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts
index ae256a62..580f67cb 100644
--- a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts
@@ -1,3 +1,5 @@
+import gradle.kotlin.dsl.accessors._9bf86420fccbde1948375f641de89b70.sourceSets
+
/*
* Copyright (c) 2021 AtLarge Research
*
@@ -22,10 +24,11 @@
plugins {
`java-library`
+ distribution
+ id("com.github.johnrengelman.shadow")
}
dependencies {
- implementation(project(":opendc-harness:opendc-harness-engine"))
runtimeOnly(project(":opendc-harness:opendc-harness-junit5"))
}
@@ -39,3 +42,20 @@ tasks.register<Test>("experiment") {
testClassesDirs = sourceSets["main"].output.classesDirs
classpath = sourceSets["main"].runtimeClasspath
}
+
+distributions {
+ create("experiment") {
+ contents {
+ from("README.md")
+ from(tasks.shadowJar.get())
+ }
+ }
+}
+
+tasks.shadowJar {
+ dependencies {
+ // Do not include the JUnit 5 runner in the final shadow jar, since it is only necessary for development
+ // inside IDE
+ exclude(project(":opendc-harness:opendc-harness-junit5"))
+ }
+}