summaryrefslogtreecommitdiff
path: root/simulator
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-02-23 12:37:31 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-02-23 13:04:41 +0100
commit2119427fe6f7874867c6985cacda28befc53436b (patch)
tree37af0403238382b3e2cd85d021273da9fbf09116 /simulator
parent90de768b8bfb3acc222f508d2e602ef3b7f1ff91 (diff)
Utilize version constraints for shared versions
This change updates the Gradle configuration to utilize version constraints to force the same dependency version across modules.
Diffstat (limited to 'simulator')
-rw-r--r--simulator/buildSrc/src/main/kotlin/dependency-conventions.gradle.kts43
-rw-r--r--simulator/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts7
-rw-r--r--simulator/gradle.properties24
-rw-r--r--simulator/opendc-compute/opendc-compute-core/build.gradle.kts3
-rw-r--r--simulator/opendc-compute/opendc-compute-simulator/build.gradle.kts2
-rw-r--r--simulator/opendc-core/build.gradle.kts2
-rw-r--r--simulator/opendc-experiments/opendc-experiments-sc20/build.gradle.kts10
-rw-r--r--simulator/opendc-format/build.gradle.kts9
-rw-r--r--simulator/opendc-harness/build.gradle.kts16
-rw-r--r--simulator/opendc-runner-web/build.gradle.kts12
-rw-r--r--simulator/opendc-simulator/opendc-simulator-core/build.gradle.kts2
-rw-r--r--simulator/opendc-simulator/opendc-simulator-failures/build.gradle.kts2
-rw-r--r--simulator/opendc-trace/opendc-trace-core/build.gradle.kts2
-rw-r--r--simulator/opendc-utils/build.gradle.kts2
-rw-r--r--simulator/opendc-workflows/build.gradle.kts7
15 files changed, 96 insertions, 47 deletions
diff --git a/simulator/buildSrc/src/main/kotlin/dependency-conventions.gradle.kts b/simulator/buildSrc/src/main/kotlin/dependency-conventions.gradle.kts
new file mode 100644
index 00000000..ee9ea793
--- /dev/null
+++ b/simulator/buildSrc/src/main/kotlin/dependency-conventions.gradle.kts
@@ -0,0 +1,43 @@
+import org.gradle.kotlin.dsl.`java-library`
+import org.gradle.kotlin.dsl.kotlin
+import org.gradle.kotlin.dsl.repositories
+
+/*
+ * Copyright (c) 2021 AtLarge Research
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+plugins {
+ `java-library`
+}
+
+repositories {
+ mavenCentral()
+ jcenter()
+}
+
+/* Dependency constraints across modules */
+dependencies {
+ constraints {
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.kotlinxCoroutines}")
+ implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
+ }
+}
diff --git a/simulator/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts b/simulator/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts
index 8d6420be..e9fee735 100644
--- a/simulator/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts
+++ b/simulator/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts
@@ -28,12 +28,7 @@ plugins {
`java-library`
kotlin("jvm")
id("org.jlleitschuh.gradle.ktlint")
-}
-
-/* Project configuration */
-repositories {
- mavenCentral()
- jcenter()
+ id("dependency-conventions")
}
java {
diff --git a/simulator/gradle.properties b/simulator/gradle.properties
index eb92399d..fb007dde 100644
--- a/simulator/gradle.properties
+++ b/simulator/gradle.properties
@@ -21,9 +21,27 @@
#
# Dependencies
-junit-jupiter.version = 5.7.1
-junit-platform.version = 1.7.1
+kotlinx-coroutines.version = 1.4.2
+
+# Dependencies (Logging)
kotlin-logging.version = 2.0.4
slf4j.version = 1.7.30
log4j.version = 2.14.0
-kotlinx-coroutines.version = 1.4.2
+
+# Dependencies (CLI)
+clikt.version = 3.1.0
+progressbar.version = 0.9.0
+
+# Dependencies (Format)
+jackson-module-kotlin.version = 2.12.0
+parquet-avro.version = 1.11.1
+hadoop-client.version = 3.2.1
+
+# Dependencies (Other)
+sentry-log4j2.version = 4.2.0
+mongodb-driver-sync.version = 4.2.1
+classgraph.version = 4.8.102
+
+# Dependencies (Testing)
+junit-jupiter.version = 5.7.1
+junit-platform.version = 1.7.1
diff --git a/simulator/opendc-compute/opendc-compute-core/build.gradle.kts b/simulator/opendc-compute/opendc-compute-core/build.gradle.kts
index c6d254d1..f3548b04 100644
--- a/simulator/opendc-compute/opendc-compute-core/build.gradle.kts
+++ b/simulator/opendc-compute/opendc-compute-core/build.gradle.kts
@@ -31,5 +31,6 @@ dependencies {
api(project(":opendc-core"))
api(project(":opendc-trace:opendc-trace-core"))
implementation(project(":opendc-utils"))
- implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
+
+ implementation("io.github.microutils:kotlin-logging")
}
diff --git a/simulator/opendc-compute/opendc-compute-simulator/build.gradle.kts b/simulator/opendc-compute/opendc-compute-simulator/build.gradle.kts
index 00fdd780..148578cb 100644
--- a/simulator/opendc-compute/opendc-compute-simulator/build.gradle.kts
+++ b/simulator/opendc-compute/opendc-compute-simulator/build.gradle.kts
@@ -33,7 +33,7 @@ dependencies {
api(project(":opendc-simulator:opendc-simulator-compute"))
api(project(":opendc-simulator:opendc-simulator-failures"))
implementation(project(":opendc-utils"))
- implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
+ implementation("io.github.microutils:kotlin-logging")
testImplementation(project(":opendc-simulator:opendc-simulator-core"))
testRuntimeOnly("org.slf4j:slf4j-simple:${versions.slf4j}")
diff --git a/simulator/opendc-core/build.gradle.kts b/simulator/opendc-core/build.gradle.kts
index ce2cae26..e685eddc 100644
--- a/simulator/opendc-core/build.gradle.kts
+++ b/simulator/opendc-core/build.gradle.kts
@@ -28,5 +28,5 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}
diff --git a/simulator/opendc-experiments/opendc-experiments-sc20/build.gradle.kts b/simulator/opendc-experiments/opendc-experiments-sc20/build.gradle.kts
index 6592c86f..8127d9eb 100644
--- a/simulator/opendc-experiments/opendc-experiments-sc20/build.gradle.kts
+++ b/simulator/opendc-experiments/opendc-experiments-sc20/build.gradle.kts
@@ -43,12 +43,12 @@ dependencies {
implementation(project(":opendc-simulator:opendc-simulator-failures"))
implementation(project(":opendc-compute:opendc-compute-simulator"))
- implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
- implementation("me.tongfei:progressbar:0.9.0")
- implementation("com.github.ajalt.clikt:clikt:3.1.0")
+ implementation("io.github.microutils:kotlin-logging")
+ implementation("me.tongfei:progressbar:${versions["progressbar"]}")
+ implementation("com.github.ajalt.clikt:clikt:${versions["clikt"]}")
- implementation("org.apache.parquet:parquet-avro:1.11.0")
- implementation("org.apache.hadoop:hadoop-client:3.2.1") {
+ implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}")
+ implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") {
exclude(group = "org.slf4j", module = "slf4j-log4j12")
exclude(group = "log4j")
}
diff --git a/simulator/opendc-format/build.gradle.kts b/simulator/opendc-format/build.gradle.kts
index 6902425a..1f6c28aa 100644
--- a/simulator/opendc-format/build.gradle.kts
+++ b/simulator/opendc-format/build.gradle.kts
@@ -34,13 +34,10 @@ dependencies {
api(project(":opendc-workflows"))
implementation(project(":opendc-simulator:opendc-simulator-compute"))
implementation(project(":opendc-compute:opendc-compute-simulator"))
- implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8") {
- exclude("org.jetbrains.kotlin", module = "kotlin-reflect")
- }
- implementation(kotlin("reflect"))
+ api("com.fasterxml.jackson.module:jackson-module-kotlin:${versions["jackson-module-kotlin"]}")
- implementation("org.apache.parquet:parquet-avro:1.11.0")
- implementation("org.apache.hadoop:hadoop-client:3.2.1") {
+ implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}")
+ implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") {
exclude(group = "org.slf4j", module = "slf4j-log4j12")
exclude(group = "log4j")
}
diff --git a/simulator/opendc-harness/build.gradle.kts b/simulator/opendc-harness/build.gradle.kts
index ebede556..25ffbd57 100644
--- a/simulator/opendc-harness/build.gradle.kts
+++ b/simulator/opendc-harness/build.gradle.kts
@@ -29,17 +29,17 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
api("org.junit.platform:junit-platform-commons:${versions.junitPlatform}")
- implementation("io.github.classgraph:classgraph:4.8.98")
- implementation("me.tongfei:progressbar:0.9.0")
- implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
- implementation("com.github.ajalt.clikt:clikt:3.1.0")
+ implementation("io.github.classgraph:classgraph:${versions["classgraph"]}")
+ implementation("io.github.microutils:kotlin-logging")
+ implementation("com.github.ajalt.clikt:clikt:${versions["clikt"]}")
+ implementation("me.tongfei:progressbar:${versions["progressbar"]}")
- api("org.junit.platform:junit-platform-engine:${versions.junitPlatform}")
- api("org.junit.platform:junit-platform-suite-api:${versions.junitPlatform}")
- api("org.junit.platform:junit-platform-launcher:${versions.junitPlatform}")
+ implementation("org.junit.platform:junit-platform-engine:${versions.junitPlatform}")
+ implementation("org.junit.platform:junit-platform-suite-api:${versions.junitPlatform}")
+ implementation("org.junit.platform:junit-platform-launcher:${versions.junitPlatform}")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}")
}
diff --git a/simulator/opendc-runner-web/build.gradle.kts b/simulator/opendc-runner-web/build.gradle.kts
index 0439ca0b..85b24e19 100644
--- a/simulator/opendc-runner-web/build.gradle.kts
+++ b/simulator/opendc-runner-web/build.gradle.kts
@@ -40,13 +40,11 @@ dependencies {
implementation(project(":opendc-simulator:opendc-simulator-core"))
implementation(project(":opendc-simulator:opendc-simulator-compute"))
- implementation("com.github.ajalt:clikt:2.8.0")
- implementation("io.github.microutils:kotlin-logging:${versions.kotlinLogging}")
- implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8") {
- exclude("org.jetbrains.kotlin", module = "kotlin-reflect")
- }
- implementation("io.sentry:sentry-log4j2:3.1.1")
- implementation("org.mongodb:mongodb-driver-sync:4.0.5")
+ implementation("io.github.microutils:kotlin-logging")
+ implementation("com.github.ajalt.clikt:clikt:${versions["clikt"]}")
+ implementation("com.fasterxml.jackson.module:jackson-module-kotlin:${versions["jackson-module-kotlin"]}")
+ implementation("io.sentry:sentry-log4j2:${versions["sentry-log4j2"]}")
+ implementation("org.mongodb:mongodb-driver-sync:${versions["mongodb-driver-sync"]}")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}")
runtimeOnly("org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}")
diff --git a/simulator/opendc-simulator/opendc-simulator-core/build.gradle.kts b/simulator/opendc-simulator/opendc-simulator-core/build.gradle.kts
index db681ef0..c2175043 100644
--- a/simulator/opendc-simulator/opendc-simulator-core/build.gradle.kts
+++ b/simulator/opendc-simulator/opendc-simulator-core/build.gradle.kts
@@ -28,5 +28,5 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-test")
}
diff --git a/simulator/opendc-simulator/opendc-simulator-failures/build.gradle.kts b/simulator/opendc-simulator/opendc-simulator-failures/build.gradle.kts
index 76f77a90..5220992d 100644
--- a/simulator/opendc-simulator/opendc-simulator-failures/build.gradle.kts
+++ b/simulator/opendc-simulator/opendc-simulator-failures/build.gradle.kts
@@ -27,5 +27,5 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}
diff --git a/simulator/opendc-trace/opendc-trace-core/build.gradle.kts b/simulator/opendc-trace/opendc-trace-core/build.gradle.kts
index a5243a63..fd94d89d 100644
--- a/simulator/opendc-trace/opendc-trace-core/build.gradle.kts
+++ b/simulator/opendc-trace/opendc-trace-core/build.gradle.kts
@@ -28,5 +28,5 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}
diff --git a/simulator/opendc-utils/build.gradle.kts b/simulator/opendc-utils/build.gradle.kts
index 788c2072..8f587939 100644
--- a/simulator/opendc-utils/build.gradle.kts
+++ b/simulator/opendc-utils/build.gradle.kts
@@ -29,7 +29,7 @@ plugins {
}
dependencies {
- api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}")
+ api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
testImplementation(project(":opendc-simulator:opendc-simulator-core"))
}
diff --git a/simulator/opendc-workflows/build.gradle.kts b/simulator/opendc-workflows/build.gradle.kts
index 74a0fbc3..b4ffac7d 100644
--- a/simulator/opendc-workflows/build.gradle.kts
+++ b/simulator/opendc-workflows/build.gradle.kts
@@ -38,9 +38,6 @@ dependencies {
testImplementation(project(":opendc-simulator:opendc-simulator-core"))
testImplementation(project(":opendc-compute:opendc-compute-simulator"))
testImplementation(project(":opendc-format"))
- testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8") {
- exclude("org.jetbrains.kotlin", module = "kotlin-reflect")
- }
- testImplementation(kotlin("reflect"))
- testRuntimeOnly("org.slf4j:slf4j-simple:${versions.kotlinxCoroutines}")
+ testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:${versions["jackson-module-kotlin"]}")
+ testRuntimeOnly("org.slf4j:slf4j-simple:${versions.slf4j}")
}