summaryrefslogtreecommitdiff
path: root/simulator/buildSrc
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/buildSrc
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/buildSrc')
-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
2 files changed, 44 insertions, 6 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 {