From 2119427fe6f7874867c6985cacda28befc53436b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 23 Feb 2021 12:37:31 +0100 Subject: Utilize version constraints for shared versions This change updates the Gradle configuration to utilize version constraints to force the same dependency version across modules. --- .../main/kotlin/dependency-conventions.gradle.kts | 43 ++++++++++++++++++++++ .../kotlin/kotlin-library-conventions.gradle.kts | 7 +--- 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 simulator/buildSrc/src/main/kotlin/dependency-conventions.gradle.kts (limited to 'simulator/buildSrc') 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 { -- cgit v1.2.3