diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-07 16:26:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-07 16:26:10 +0200 |
| commit | 6779f62e6f54b783da348dc1aba248656f7956f7 (patch) | |
| tree | 068a38613d29bdbd4fe39aee90fde86343c656f3 | |
| parent | d60e230c29beeeaa825987d5abf43c1e6f450dad (diff) | |
| parent | efea162372be99beb4de90929629c7ebccdb8d84 (diff) | |
build: Use Gradle version catalog
This pull request updates the Gradle build configuration to use the new version
catalog functionality, which allows us to store our dependency versions in a
centralized file located at `gradle/libs.versions.toml`.
Our previous approach stored the versions in `gradle.properties`.
The benefit of this approach however is that (1) it will be supported by
Gradle and (2) it allows us to access dependencies safely.
32 files changed, 135 insertions, 177 deletions
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 73c4fdf8..3b793a61 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -28,12 +28,8 @@ plugins { /* Project configuration */ repositories { + mavenCentral() gradlePluginPortal() - maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") { - content { - includeGroup("org.jetbrains.kotlinx") - } - } } dependencies { diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Libs.kt index bb187a40..9567845a 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -24,41 +24,35 @@ import org.gradle.api.JavaVersion import org.gradle.api.Project -import org.gradle.kotlin.dsl.extra +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.kotlin.dsl.getByType import kotlin.properties.ReadOnlyProperty /** - * This class contains the versions of the dependencies shared by the different - * subprojects. + * This class makes the version catalog accessible for the build scripts until Gradle adds support for it. + * + * See https://github.com/gradle/gradle/issues/15383 */ -public class Versions(private val project: Project) { +@Suppress("UnstableApiUsage") +public class Libs(project: Project) { + /** + * The version catalog of the project. + */ + private val versionCatalog = project.extensions.getByType(VersionCatalogsExtension::class).named("libs") + /** * A delegate for obtaining configuration values from a [Project] instance. */ - private fun version(name: String? = null): ReadOnlyProperty<Versions, String> = + private fun lib(name: String? = null): ReadOnlyProperty<Libs, String> = ReadOnlyProperty { _, property -> get(name ?: property.name) } - val junitJupiter by version(name = "junit-jupiter") - val junitPlatform by version(name = "junit-platform") - val mockk by version() - - val slf4j by version() - val kotlinLogging by version(name = "kotlin-logging") - val log4j by version() - val config by version() - - val kotlinxCoroutines by version(name = "kotlinx-coroutines") - - val otelApi by version(name = "opentelemetry-api") - val otelApiMetrics by version(name = "opentelemetry-api-metrics") - val otelSdk by version(name = "opentelemetry-sdk") - val otelSdkMetrics by version(name = "opentelemetry-sdk-metrics") - - /** * Obtain the version for the specified [dependency][name]. */ - operator fun get(name: String) = project.extra.get("$name.version") as String + operator fun get(name: String): String { + val dep = versionCatalog.findDependency(name).get().get() + return "${dep.module.group}:${dep.module.name}:${dep.versionConstraint.displayName}" + } companion object { /** diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt deleted file mode 100644 index ddf643f6..00000000 --- a/buildSrc/src/main/kotlin/ProjectExtensions.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -import org.gradle.api.Project -import org.gradle.kotlin.dsl.extra -import org.gradle.kotlin.dsl.provideDelegate - -/** - * Obtain the [Versions] object for the specified [Project] instance. - */ -val Project.versions: Versions - get() { - var versions: Versions? by rootProject.extra - return versions ?: Versions(rootProject).also { versions = it } - } diff --git a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts index 8623e8da..4e73d4d3 100644 --- a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts @@ -55,13 +55,14 @@ benchmark { } } +dependencies { + val libs = Libs(project) + implementation(libs["kotlinx-benchmark-runtime-jvm"]) +} + // Workaround for https://github.com/Kotlin/kotlinx-benchmark/issues/39 afterEvaluate { tasks.named<org.gradle.jvm.tasks.Jar>("jmhBenchmarkJar") { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } } - -dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm:0.3.0") -} diff --git a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts index 7bab52fc..703e9938 100644 --- a/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts @@ -34,11 +34,11 @@ repositories { } java { - sourceCompatibility = Versions.jvmTarget + sourceCompatibility = Libs.jvmTarget } tasks.withType<KotlinCompile>().configureEach { - kotlinOptions.jvmTarget = Versions.jvmTarget.toString() + kotlinOptions.jvmTarget = Libs.jvmTarget.toString() kotlinOptions.useIR = true kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" } diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index f129c282..7d344500 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -34,8 +34,10 @@ tasks.test { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junitJupiter}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junitJupiter}") - testImplementation("org.junit.jupiter:junit-jupiter-params:${versions.junitJupiter}") - testImplementation("io.mockk:mockk:${versions.mockk}") + val libs = Libs(project) + + testImplementation(libs["junit-jupiter-api"]) + testImplementation(libs["junit-jupiter-params"]) + testImplementation(libs["mockk"]) + testRuntimeOnly(libs["junit-jupiter-engine"]) } diff --git a/gradle.properties b/gradle.properties index ea35e589..52648593 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,37 +22,3 @@ # For Dokka https://github.com/Kotlin/dokka/issues/1405 org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G - -# Dependencies -kotlinx-coroutines.version = 1.4.3 - -# Dependencies (Logging) -kotlin-logging.version = 2.0.6 -slf4j.version = 1.7.30 -log4j.version = 2.14.1 - -# Dependencies (Telemetry) -opentelemetry-api.version = 1.1.0 -opentelemetry-api-metrics.version = 1.1.0-alpha -opentelemetry-sdk.version = 1.1.0 -opentelemetry-sdk-metrics.version = 1.1.0-alpha - -# 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 -config.version = 1.4.1 - -# Dependencies (Testing) -junit-jupiter.version = 5.7.1 -junit-platform.version = 1.7.1 -mockk.version = 1.11.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..12cbfb4e --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,48 @@ +[versions] +junit-jupiter = "5.7.1" +junit-platform = "1.7.1" +slf4j = "1.7.30" +log4j = "2.14.1" +opentelemetry-main = "1.1.0" +opentelemetry-metrics = "1.1.0-alpha" + +[libraries] +kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } + +# Logging +kotlin-logging = { module = "io.github.microutils:kotlin-logging", version = "2.0.6" } +slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } +log4j-slf4j = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" } +sentry-log4j2 = { module = "io.sentry:sentry-log4j2", version = "4.3.0" } + +# Telemetry +opentelemetry-api-main = { module = "io.opentelemetry:opentelemetry-api", version.ref = "opentelemetry-main" } +opentelemetry-sdk-main = { module = "io.opentelemetry:opentelemetry-sdk", version.ref = "opentelemetry-main" } +opentelemetry-api-metrics = { module = "io.opentelemetry:opentelemetry-api-metrics", version.ref = "opentelemetry-metrics" } +opentelemetry-sdk-metrics = { module = "io.opentelemetry:opentelemetry-sdk-metrics", version.ref = "opentelemetry-metrics" } + +# Testing +junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" } +junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" } +junit-platform-commons = { module = "org.junit.platform:junit-platform-commons", version.ref = "junit-platform" } +junit-platform-engine = { module = "org.junit.platform:junit-platform-engine", version.ref = "junit-platform" } +mockk = { module = "io.mockk:mockk", version = "1.11.0" } + +# CLI +clikt = { module = "com.github.ajalt.clikt:clikt", version = "3.1.0" } +progressbar = { module = "me.tongfei:progressbar", version = "0.9.0" } + +# Format +jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.12.0" } +parquet = { module = "org.apache.parquet:parquet-avro", version = "1.12.0" } +yaml = { module = "org.yaml:snakeyaml", version = "1.28" } +config = { module = "com.typesafe:config", version = "1.4.1" } + +# Benchmark +kotlinx-benchmark-runtime-jvm = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm", version = "0.3.0" } + +# Other +mongodb = { module = "org.mongodb:mongodb-driver-sync", version = "4.2.3" } +classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.105" } +hadoop-client = { module = "org.apache.hadoop:hadoop-client", version = "3.2.1" } diff --git a/opendc-compute/opendc-compute-service/build.gradle.kts b/opendc-compute/opendc-compute-service/build.gradle.kts index 4e1be97a..e0e48b0f 100644 --- a/opendc-compute/opendc-compute-service/build.gradle.kts +++ b/opendc-compute/opendc-compute-service/build.gradle.kts @@ -34,8 +34,8 @@ dependencies { api(projects.opendcCompute.opendcComputeApi) api(projects.opendcTelemetry.opendcTelemetryApi) implementation(projects.opendcUtils) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) - testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testRuntimeOnly(libs.log4j.slf4j) } diff --git a/opendc-compute/opendc-compute-simulator/build.gradle.kts b/opendc-compute/opendc-compute-simulator/build.gradle.kts index 0d0a57ad..b31a2114 100644 --- a/opendc-compute/opendc-compute-simulator/build.gradle.kts +++ b/opendc-compute/opendc-compute-simulator/build.gradle.kts @@ -35,9 +35,9 @@ dependencies { api(projects.opendcSimulator.opendcSimulatorCompute) api(projects.opendcSimulator.opendcSimulatorFailures) implementation(projects.opendcUtils) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) testImplementation(projects.opendcTelemetry.opendcTelemetrySdk) - testRuntimeOnly("org.slf4j:slf4j-simple:${versions.slf4j}") + testRuntimeOnly(libs.slf4j.simple) } diff --git a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts index ca4aa35f..7c7f0dad 100644 --- a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts @@ -36,17 +36,16 @@ dependencies { implementation(projects.opendcSimulator.opendcSimulatorCompute) implementation(projects.opendcSimulator.opendcSimulatorFailures) implementation(projects.opendcCompute.opendcComputeSimulator) + implementation(projects.opendcTelemetry.opendcTelemetrySdk) - implementation("io.github.microutils:kotlin-logging") - implementation("com.typesafe:config") - implementation("me.tongfei:progressbar:${versions["progressbar"]}") - implementation("com.github.ajalt.clikt:clikt:${versions["clikt"]}") + implementation(libs.kotlin.logging) + implementation(libs.config) + implementation(libs.progressbar) + implementation(libs.clikt) - implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}") - implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") { + implementation(libs.parquet) + implementation(libs.hadoop.client) { exclude(group = "org.slf4j", module = "slf4j-log4j12") exclude(group = "log4j") } - - implementation(projects.opendcTelemetry.opendcTelemetrySdk) } diff --git a/opendc-experiments/opendc-experiments-energy21/build.gradle.kts b/opendc-experiments/opendc-experiments-energy21/build.gradle.kts index 64e52f88..bc05f09b 100644 --- a/opendc-experiments/opendc-experiments-energy21/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-energy21/build.gradle.kts @@ -38,11 +38,10 @@ dependencies { implementation(projects.opendcCompute.opendcComputeSimulator) implementation(projects.opendcExperiments.opendcExperimentsCapelin) implementation(projects.opendcTelemetry.opendcTelemetrySdk) - implementation("io.github.microutils:kotlin-logging") - implementation("com.typesafe:config") + implementation(libs.kotlin.logging) + implementation(libs.config) - implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}") - implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") { + implementation(libs.parquet) { exclude(group = "org.slf4j", module = "slf4j-log4j12") exclude(group = "log4j") } diff --git a/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts b/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts index c35070fe..bdb0d098 100644 --- a/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts @@ -35,11 +35,10 @@ dependencies { implementation(projects.opendcServerless.opendcServerlessService) implementation(projects.opendcServerless.opendcServerlessSimulator) implementation(projects.opendcTelemetry.opendcTelemetrySdk) - implementation("io.github.microutils:kotlin-logging") - implementation("com.typesafe:config") + implementation(libs.kotlin.logging) + implementation(libs.config) - implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}") - implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") { + implementation(libs.parquet) { exclude(group = "org.slf4j", module = "slf4j-log4j12") exclude(group = "log4j") } diff --git a/opendc-format/build.gradle.kts b/opendc-format/build.gradle.kts index cfe849e2..2647c834 100644 --- a/opendc-format/build.gradle.kts +++ b/opendc-format/build.gradle.kts @@ -35,10 +35,10 @@ dependencies { api(projects.opendcWorkflow.opendcWorkflowApi) implementation(projects.opendcSimulator.opendcSimulatorCompute) implementation(projects.opendcCompute.opendcComputeSimulator) - api("com.fasterxml.jackson.module:jackson-module-kotlin:${versions["jackson-module-kotlin"]}") + api(libs.jackson.module.kotlin) - implementation("org.apache.parquet:parquet-avro:${versions["parquet-avro"]}") - implementation("org.apache.hadoop:hadoop-client:${versions["hadoop-client"]}") { + implementation(libs.parquet) + implementation(libs.hadoop.client) { exclude(group = "org.slf4j", module = "slf4j-log4j12") exclude(group = "log4j") } diff --git a/opendc-harness/opendc-harness-api/build.gradle.kts b/opendc-harness/opendc-harness-api/build.gradle.kts index 02adae9a..5c464377 100644 --- a/opendc-harness/opendc-harness-api/build.gradle.kts +++ b/opendc-harness/opendc-harness-api/build.gradle.kts @@ -29,7 +29,7 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("org.junit.platform:junit-platform-commons:${versions.junitPlatform}") + api(libs.junit.platform.commons) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) } diff --git a/opendc-harness/opendc-harness-cli/build.gradle.kts b/opendc-harness/opendc-harness-cli/build.gradle.kts index b1f049de..5d0c0460 100644 --- a/opendc-harness/opendc-harness-cli/build.gradle.kts +++ b/opendc-harness/opendc-harness-cli/build.gradle.kts @@ -37,9 +37,9 @@ dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcHarness.opendcHarnessEngine) - implementation("io.github.microutils:kotlin-logging") - implementation("com.github.ajalt.clikt:clikt:${versions["clikt"]}") - implementation("me.tongfei:progressbar:${versions["progressbar"]}") + implementation(libs.kotlin.logging) + implementation(libs.clikt) + implementation(libs.progressbar) - runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}") + runtimeOnly(libs.log4j.slf4j) } diff --git a/opendc-harness/opendc-harness-engine/build.gradle.kts b/opendc-harness/opendc-harness-engine/build.gradle.kts index 6b59cbed..cbd10f6a 100644 --- a/opendc-harness/opendc-harness-engine/build.gradle.kts +++ b/opendc-harness/opendc-harness-engine/build.gradle.kts @@ -32,8 +32,8 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcHarness.opendcHarnessApi) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") + api(libs.kotlinx.coroutines) - implementation("io.github.classgraph:classgraph:${versions["classgraph"]}") - implementation("io.github.microutils:kotlin-logging") + implementation(libs.classgraph) + implementation(libs.kotlin.logging) } diff --git a/opendc-harness/opendc-harness-junit5/build.gradle.kts b/opendc-harness/opendc-harness-junit5/build.gradle.kts index ba0f323f..e63367d3 100644 --- a/opendc-harness/opendc-harness-junit5/build.gradle.kts +++ b/opendc-harness/opendc-harness-junit5/build.gradle.kts @@ -31,6 +31,6 @@ dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcHarness.opendcHarnessEngine) - implementation("io.github.microutils:kotlin-logging") - implementation("org.junit.platform:junit-platform-engine:${versions.junitPlatform}") + implementation(libs.kotlin.logging) + implementation(libs.junit.platform.engine) } diff --git a/opendc-platform/build.gradle.kts b/opendc-platform/build.gradle.kts index 3fbc144e..35d12434 100644 --- a/opendc-platform/build.gradle.kts +++ b/opendc-platform/build.gradle.kts @@ -25,15 +25,3 @@ plugins { } description = "Java platform for the OpenDC project" - -dependencies { - constraints { - api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}") - api("org.jetbrains.kotlinx:kotlinx-coroutines-test:${versions.kotlinxCoroutines}") - - api("com.typesafe:config:1.4.1") - api("io.github.microutils:kotlin-logging:${versions.kotlinLogging}") - runtime("org.slf4j:slf4j-simple:${versions.slf4j}") - runtime("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}") - } -} diff --git a/opendc-serverless/opendc-serverless-service/build.gradle.kts b/opendc-serverless/opendc-serverless-service/build.gradle.kts index 9aae05fc..bce72c72 100644 --- a/opendc-serverless/opendc-serverless-service/build.gradle.kts +++ b/opendc-serverless/opendc-serverless-service/build.gradle.kts @@ -34,8 +34,8 @@ dependencies { api(projects.opendcServerless.opendcServerlessApi) api(projects.opendcTelemetry.opendcTelemetryApi) implementation(projects.opendcUtils) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) - testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testRuntimeOnly(libs.log4j.slf4j) } diff --git a/opendc-serverless/opendc-serverless-simulator/build.gradle.kts b/opendc-serverless/opendc-serverless-simulator/build.gradle.kts index 08014fce..5e2c522d 100644 --- a/opendc-serverless/opendc-serverless-simulator/build.gradle.kts +++ b/opendc-serverless/opendc-serverless-simulator/build.gradle.kts @@ -35,5 +35,5 @@ dependencies { api(projects.opendcSimulator.opendcSimulatorCompute) testImplementation(projects.opendcSimulator.opendcSimulatorCore) - testRuntimeOnly("org.slf4j:slf4j-simple:${versions.slf4j}") + testRuntimeOnly(libs.slf4j.simple) } diff --git a/opendc-simulator/opendc-simulator-compute/build.gradle.kts b/opendc-simulator/opendc-simulator-compute/build.gradle.kts index a7d396c7..4eb0be33 100644 --- a/opendc-simulator/opendc-simulator-compute/build.gradle.kts +++ b/opendc-simulator/opendc-simulator-compute/build.gradle.kts @@ -34,5 +34,5 @@ dependencies { api(projects.opendcSimulator.opendcSimulatorResources) implementation(projects.opendcSimulator.opendcSimulatorCore) implementation(projects.opendcUtils) - implementation("org.yaml:snakeyaml:1.28") + implementation(libs.yaml) } diff --git a/opendc-simulator/opendc-simulator-core/build.gradle.kts b/opendc-simulator/opendc-simulator-core/build.gradle.kts index 485bf5a6..6dbf4199 100644 --- a/opendc-simulator/opendc-simulator-core/build.gradle.kts +++ b/opendc-simulator/opendc-simulator-core/build.gradle.kts @@ -29,5 +29,5 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") + api(libs.kotlinx.coroutines) } diff --git a/opendc-simulator/opendc-simulator-failures/build.gradle.kts b/opendc-simulator/opendc-simulator-failures/build.gradle.kts index 6c266d23..57cd0a35 100644 --- a/opendc-simulator/opendc-simulator-failures/build.gradle.kts +++ b/opendc-simulator/opendc-simulator-failures/build.gradle.kts @@ -28,5 +28,5 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") + api(libs.kotlinx.coroutines) } diff --git a/opendc-simulator/opendc-simulator-resources/build.gradle.kts b/opendc-simulator/opendc-simulator-resources/build.gradle.kts index 08e0bc78..e4ffc3ff 100644 --- a/opendc-simulator/opendc-simulator-resources/build.gradle.kts +++ b/opendc-simulator/opendc-simulator-resources/build.gradle.kts @@ -31,7 +31,7 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") + api(libs.kotlinx.coroutines) implementation(projects.opendcUtils) jmhImplementation(projects.opendcSimulator.opendcSimulatorCore) diff --git a/opendc-telemetry/opendc-telemetry-api/build.gradle.kts b/opendc-telemetry/opendc-telemetry-api/build.gradle.kts index 927e9bc5..c544b7d6 100644 --- a/opendc-telemetry/opendc-telemetry-api/build.gradle.kts +++ b/opendc-telemetry/opendc-telemetry-api/build.gradle.kts @@ -29,6 +29,6 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("io.opentelemetry:opentelemetry-api:${versions.otelApi}") - api("io.opentelemetry:opentelemetry-api-metrics:${versions.otelApiMetrics}") + api(libs.opentelemetry.api.main) + api(libs.opentelemetry.api.metrics) } diff --git a/opendc-telemetry/opendc-telemetry-sdk/build.gradle.kts b/opendc-telemetry/opendc-telemetry-sdk/build.gradle.kts index b845c1c9..3b918775 100644 --- a/opendc-telemetry/opendc-telemetry-sdk/build.gradle.kts +++ b/opendc-telemetry/opendc-telemetry-sdk/build.gradle.kts @@ -30,9 +30,9 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcTelemetry.opendcTelemetryApi) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") - api("io.opentelemetry:opentelemetry-sdk:${versions.otelSdk}") - api("io.opentelemetry:opentelemetry-sdk-metrics:${versions.otelSdkMetrics}") + api(libs.kotlinx.coroutines) + api(libs.opentelemetry.sdk.main) + api(libs.opentelemetry.sdk.metrics) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) } diff --git a/opendc-utils/build.gradle.kts b/opendc-utils/build.gradle.kts index 9f712b89..800b374d 100644 --- a/opendc-utils/build.gradle.kts +++ b/opendc-utils/build.gradle.kts @@ -30,7 +30,7 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") + api(libs.kotlinx.coroutines) testImplementation(projects.opendcSimulator.opendcSimulatorCore) } diff --git a/opendc-web/opendc-web-runner/build.gradle.kts b/opendc-web/opendc-web-runner/build.gradle.kts index 60a24b92..b7eb223c 100644 --- a/opendc-web/opendc-web-runner/build.gradle.kts +++ b/opendc-web/opendc-web-runner/build.gradle.kts @@ -40,12 +40,11 @@ dependencies { implementation(projects.opendcSimulator.opendcSimulatorCore) implementation(projects.opendcTelemetry.opendcTelemetrySdk) - 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"]}") + implementation(libs.kotlin.logging) + implementation(libs.clikt) + implementation(libs.jackson.module.kotlin) + implementation(libs.sentry.log4j2) + implementation(libs.mongodb) - runtimeOnly("org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}") - runtimeOnly("org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}") + runtimeOnly(libs.log4j.slf4j) } diff --git a/opendc-workflow/opendc-workflow-api/build.gradle.kts b/opendc-workflow/opendc-workflow-api/build.gradle.kts index 45657d27..36239d05 100644 --- a/opendc-workflow/opendc-workflow-api/build.gradle.kts +++ b/opendc-workflow/opendc-workflow-api/build.gradle.kts @@ -30,5 +30,5 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcCompute.opendcComputeApi) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) } diff --git a/opendc-workflow/opendc-workflow-service/build.gradle.kts b/opendc-workflow/opendc-workflow-service/build.gradle.kts index 8cc66e4c..5e73222c 100644 --- a/opendc-workflow/opendc-workflow-service/build.gradle.kts +++ b/opendc-workflow/opendc-workflow-service/build.gradle.kts @@ -35,12 +35,12 @@ dependencies { api(projects.opendcCompute.opendcComputeApi) api(projects.opendcTelemetry.opendcTelemetryApi) implementation(projects.opendcUtils) - implementation("io.github.microutils:kotlin-logging") + implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) testImplementation(projects.opendcCompute.opendcComputeSimulator) testImplementation(projects.opendcFormat) testImplementation(projects.opendcTelemetry.opendcTelemetrySdk) - testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:${versions["jackson-module-kotlin"]}") - testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl") + testImplementation(libs.jackson.module.kotlin) + testRuntimeOnly(libs.log4j.slf4j) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 844c98e7..3e6d6087 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -49,4 +49,5 @@ include(":opendc-harness:opendc-harness-cli") include(":opendc-harness:opendc-harness-junit5") include(":opendc-utils") +enableFeaturePreview("VERSION_CATALOGS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") |
