Skip to content

Commit

Permalink
Switch to using a Gradle version catalog to track dependencies (#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
cacay authored Feb 27, 2024
1 parent 159f771 commit a59c6fe
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 45 deletions.
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 */
Expand Down
14 changes: 7 additions & 7 deletions cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
20 changes: 10 additions & 10 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
dependencies {
classpath("com.github.vbmacher:java-cup:11b-20160615-2")
classpath(libs.java.cup)
}
}

plugins {
kotlin("jvm")

// Lexing & Parsing
id("org.xbib.gradle.plugin.jflex") version "1.7.0"
alias(libs.plugins.jflex)
}

/** Dependencies */
Expand All @@ -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"))
Expand Down
16 changes: 8 additions & 8 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 {
Expand Down
41 changes: 41 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
6 changes: 3 additions & 3 deletions interpreter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
6 changes: 3 additions & 3 deletions runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
4 changes: 2 additions & 2 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
6 changes: 3 additions & 3 deletions test-utilities/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a59c6fe

Please sign in to comment.