diff --git a/build.gradle.kts b/build.gradle.kts index 12721319fa..dc9a68e5bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,15 +1,15 @@ plugins { - kotlin("multiplatform") version "1.8.21" apply false - kotlin("plugin.serialization") version "1.8.21" apply false + alias(libs.plugins.kotlin.multiplatform) apply false + alias(libs.plugins.kotlin.serialization) apply false // Versioning - id("com.palantir.git-version") version "3.0.0" + alias(libs.plugins.git.version) // Documentation - id("org.jetbrains.dokka") version "1.8.20" + alias(libs.plugins.dokka) // Style checking - id("com.diffplug.spotless") version "6.18.0" + alias(libs.plugins.spotless) } // Derive version from Git tags @@ -71,10 +71,10 @@ subprojects { dependencies { // Logging - "implementation"("io.github.microutils:kotlin-logging:3.0.5") - "testImplementation"(platform("org.apache.logging.log4j:log4j-bom:2.20.0")) - "testImplementation"("org.apache.logging.log4j:log4j-core") - "testImplementation"("org.apache.logging.log4j:log4j-slf4j2-impl") + "implementation"(libs.kotlin.logging) + "testImplementation"(platform(libs.log4j.bom)) + "testImplementation"(libs.log4j.core) + "testImplementation"(libs.log4j.slf4j2.impl) } /** Testing */ diff --git a/cli/build.gradle.kts b/cli/build.gradle.kts index 09a4d95b3b..2b1f5bf777 100644 --- a/cli/build.gradle.kts +++ b/cli/build.gradle.kts @@ -20,19 +20,19 @@ dependencies { implementation(project(":interpreter")) // Command-line-argument parsing - implementation("com.github.ajalt.clikt:clikt:3.5.2") + implementation(libs.clikt) // Colored terminal output - implementation("org.fusesource.jansi:jansi:2.4.0") + implementation(libs.jansi) // DOT graph output - implementation("guru.nidi:graphviz-java:0.18.1") - implementation("guru.nidi:graphviz-java-all-j2v8:0.18.1") + implementation(libs.graphviz.java) + implementation(libs.graphviz.java.all.j2v8) // Logging - implementation(platform("org.apache.logging.log4j:log4j-bom:2.20.0")) - implementation("org.apache.logging.log4j:log4j-core") - implementation("org.apache.logging.log4j:log4j-slf4j2-impl") + implementation(platform(libs.log4j.bom)) + implementation(libs.log4j.core) + implementation(libs.log4j.slf4j2.impl) // Testing testImplementation(project(":test-utilities")) diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 164e682bc8..69d038ada6 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -1,6 +1,6 @@ buildscript { dependencies { - classpath("com.github.vbmacher:java-cup:11b-20160615-2") + classpath(libs.java.cup) } } @@ -8,7 +8,7 @@ plugins { kotlin("jvm") // Lexing & Parsing - id("org.xbib.gradle.plugin.jflex") version "1.7.0" + alias(libs.plugins.jflex) } /** Dependencies */ @@ -21,26 +21,26 @@ dependencies { implementation(kotlin("reflect")) // Data structures - implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.5") - implementation("com.uchuhimo:kotlinx-bimap:1.2") + implementation(libs.kotlinx.collections.immutable.jvm) + implementation(libs.kotlinx.bimap) // Graphs - implementation("org.jgrapht:jgrapht-core:1.5.2") - implementation("org.jgrapht:jgrapht-io:1.5.2") + implementation(libs.jgrapht.core) + implementation(libs.jgrapht.io) // Unicode support - implementation("com.ibm.icu:icu4j:73.1") + implementation(libs.icu4j) // Parsing - implementation("com.github.vbmacher:java-cup-runtime:11b-20160615-2") + implementation(libs.java.cup.runtime) // Code generation - api("com.squareup:kotlinpoet:1.13.2") { + api(libs.kotlinpoet) { exclude(module = "kotlin-reflect") } // SMT solving - implementation("tools.aqua:z3-turnkey:4.12.1") + implementation(libs.z3.turnkey) // Testing testImplementation(project(":test-utilities")) diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts index 8cee124200..28e02222c9 100644 --- a/examples/build.gradle.kts +++ b/examples/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - kotlin("jvm") version "1.8.21" + alias(libs.plugins.kotlin.jvm) id("io.github.apl-cornell.viaduct") application // Style checking - id("com.diffplug.spotless") version "6.18.0" + alias(libs.plugins.spotless) } group = "io.github.apl-cornell.viaduct" @@ -22,17 +22,17 @@ dependencies { implementation("${project.group}:runtime") // Command-line-argument parsing - implementation("com.github.ajalt.clikt:clikt:3.5.2") + implementation(libs.clikt) // Logging - implementation("io.github.microutils:kotlin-logging:3.0.5") - implementation(platform("org.apache.logging.log4j:log4j-bom:2.20.0")) - implementation("org.apache.logging.log4j:log4j-core") - implementation("org.apache.logging.log4j:log4j-slf4j2-impl") + implementation(libs.kotlin.logging) + implementation(platform(libs.log4j.bom)) + implementation(libs.log4j.core) + implementation(libs.log4j.slf4j2.impl) // Testing testImplementation("${project.group}:test-utilities") - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1") + testImplementation(libs.kotlinx.coroutines.core) } application { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000000..7cbb17cc6a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,41 @@ +[versions] +graphviz-java = "0.18.1" +java-cup = "11b-20160615-2" +jgrapht = "1.5.2" +kotlin = "1.8.21" + +[libraries] +aby-java = { module = "io.github.apl-cornell:aby-java", version = "0.2.2" } +clikt = { module = "com.github.ajalt.clikt:clikt", version = "3.5.2" } +graphviz-java = { module = "guru.nidi:graphviz-java", version.ref = "graphviz-java" } +graphviz-java-all-j2v8 = { module = "guru.nidi:graphviz-java-all-j2v8", version.ref = "graphviz-java" } +icu4j = { module = "com.ibm.icu:icu4j", version = "73.1" } +jansi = { module = "org.fusesource.jansi:jansi", version = "2.4.0" } +java-cup = { module = "com.github.vbmacher:java-cup", version.ref = "java-cup" } +java-cup-runtime = { module = "com.github.vbmacher:java-cup-runtime", version.ref = "java-cup" } +jgrapht-core = { module = "org.jgrapht:jgrapht-core", version.ref = "jgrapht" } +jgrapht-io = { module = "org.jgrapht:jgrapht-io", version.ref = "jgrapht" } +junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version = "5.9.3" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" } +kotlin-logging = { module = "io.github.microutils:kotlin-logging", version = "3.0.5" } +kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.13.2" } +kotlinx-bimap = { module = "com.uchuhimo:kotlinx-bimap", version = "1.2" } +kotlinx-collections-immutable-jvm = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm", version = "0.3.5" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.7.1" } +kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version = "1.5.1" } +log4j-bom = { module = "org.apache.logging.log4j:log4j-bom", version = "2.20.0" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core" } +log4j-slf4j2-impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl" } +z3-turnkey = { module = "tools.aqua:z3-turnkey", version = "4.12.1" } + +[bundles] + +[plugins] +dokka = { id = "org.jetbrains.dokka", version = "1.8.20" } +git-version = { id = "com.palantir.git-version", version = "3.0.0" } +jflex = { id = "org.xbib.gradle.plugin.jflex", version = "1.7.0" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +spotless = { id = "com.diffplug.spotless", version = "6.18.0" } diff --git a/interpreter/build.gradle.kts b/interpreter/build.gradle.kts index 2ef8fdaa76..c81d9574ca 100644 --- a/interpreter/build.gradle.kts +++ b/interpreter/build.gradle.kts @@ -9,13 +9,13 @@ dependencies { implementation(project(":compiler")) // Data structures - implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.5") + implementation(libs.kotlinx.collections.immutable.jvm) // Concurrency - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1") + implementation(libs.kotlinx.coroutines.core) // Cryptography - implementation("io.github.apl-cornell:aby-java:0.2.2") + implementation(libs.aby.java) // Testing testImplementation(project(":test-utilities")) diff --git a/runtime/build.gradle.kts b/runtime/build.gradle.kts index e3a84e6c91..2abcd18300 100644 --- a/runtime/build.gradle.kts +++ b/runtime/build.gradle.kts @@ -9,13 +9,13 @@ dependencies { api(project(":shared")) // Coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1") + implementation(libs.kotlinx.coroutines.core) // Networking - implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.5.1") + implementation(libs.kotlinx.serialization.protobuf) // Cryptography - api("io.github.apl-cornell:aby-java:0.2.2") + api(libs.aby.java) // Testing testImplementation(project(":test-utilities")) diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 89e43ba8aa..4d656122c6 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -8,10 +8,10 @@ val rootPackage: String by project.ext dependencies { // Data structures - implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.5") + implementation(libs.kotlinx.collections.immutable.jvm) // Colored terminal output - implementation("org.fusesource.jansi:jansi:2.4.0") + implementation(libs.jansi) // Testing testImplementation(project(":test-utilities")) diff --git a/test-utilities/build.gradle.kts b/test-utilities/build.gradle.kts index fbf50fb660..b728a99424 100644 --- a/test-utilities/build.gradle.kts +++ b/test-utilities/build.gradle.kts @@ -7,7 +7,7 @@ plugins { dependencies { implementation(project(":compiler")) - api("org.junit.jupiter:junit-jupiter-api:5.9.3") - api("org.junit.jupiter:junit-jupiter-params") - runtimeOnly("org.junit.jupiter:junit-jupiter-engine") + api(libs.junit.jupiter.api) + api(libs.junit.jupiter.params) + runtimeOnly(libs.junit.jupiter.engine) }