Skip to content

Commit

Permalink
migrated to gradle version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
drieks committed Aug 25, 2024
1 parent 41b00c0 commit a2a1f8a
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 36 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
dependencies {
// add the antlr-kotlin-gradle-plugin to the classpath
classpath("${Versions.antlrKotlinGroup}:antlr-kotlin-gradle-plugin:${Versions.antlrKotlin}")
classpath(libs.comStrumenta.antlrKotlinGradlePlugin)
}
}

plugins {
base
kotlin("multiplatform") version Versions.kotlin apply false
alias(libs.plugins.kotlin.multiplatform) apply false
}

// a small hack: the variable must be named like the property
Expand Down Expand Up @@ -40,6 +40,6 @@ allprojects {
}

tasks.withType<Wrapper> {
gradleVersion = Versions.gradle
gradleVersion = "8.10"
distributionType = Wrapper.DistributionType.ALL
}
2 changes: 0 additions & 2 deletions buildSrc/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

14 changes: 0 additions & 14 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

4 changes: 2 additions & 2 deletions common-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ kotlin {

val jvmMain by getting {
dependencies {
implementation("ch.qos.logback:logback-classic:1.2.10")
api("io.kotest:kotest-runner-junit5:${Versions.kotest}")
implementation(libs.chQosLogback.logbackClassic)
api(libs.ioKotest.kotestRunnerJunit5)
}
}
}
Expand Down
39 changes: 39 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[versions]
antlr-kotlin = "1.0.0-RC4"
antlr-optimized = "4.7.4"
antlr4 = "4.7.2"
kotest = "5.5.4"
kotlin = "2.0.10"
logback = "1.2.10"

[libraries.comStrumenta-antlrKotlinGradlePlugin]
module = "com.strumenta:antlr-kotlin-gradle-plugin"
version.ref = "antlr-kotlin"

[libraries.comStrumenta-antlrKotlinRuntime]
module = "com.strumenta:antlr-kotlin-runtime"
version.ref = "antlr-kotlin"

[libraries.comStrumenta-antlrKotlinTarget]
module = "com.strumenta:antlr-kotlin-target"
version.ref = "antlr-kotlin"

[libraries.comTunnelvisionlabs-antlr4]
module = "com.tunnelvisionlabs:antlr4"
version.ref = "antlr-optimized"

[libraries.orgAntlr-antlr4]
module = "org.antlr:antlr4"
version.ref = "antlr4"

[libraries.ioKotest-kotestRunnerJunit5]
module = "io.kotest:kotest-runner-junit5"
version.ref = "kotest"

[plugins.kotlin-multiplatform]
id = "org.jetbrains.kotlin.multiplatform"
version.ref = "kotlin"

[libraries.chQosLogback-logbackClassic]
module = "ch.qos.logback:logback-classic"
version.ref = "logback"
2 changes: 1 addition & 1 deletion grammar-antlr4-parser-antlr-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tasks.withType(Test::class.java).all {
}

dependencies {
antlr("org.antlr:antlr4:${Versions.antlrJava}")
antlr(libs.orgAntlr.antlr4)
api(project(":parser-antlr-java"))
api(project(":grammar-antlr4-parser-common"))
testApi(project(":common-test"))
Expand Down
2 changes: 1 addition & 1 deletion grammar-kotlin-parser-antlr-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tasks.withType(Test::class.java).all {
}

dependencies {
antlr("org.antlr:antlr4:${Versions.antlrJava}")
antlr(libs.orgAntlr.antlr4)
api(project(":parser-antlr-java"))
api(project(":grammar-kotlin-parser-common"))
testImplementation(project(":grammar-kotlin-parser-test"))
Expand Down
4 changes: 2 additions & 2 deletions grammar-kotlin-parser-antlr-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ kotlin {

tasks.register<com.strumenta.antlrkotlin.gradle.AntlrKotlinTask>("generateGrammarSource") {
antlrClasspath = configurations.detachedConfiguration(
project.dependencies.create("org.antlr:antlr4:${Versions.antlrUsedByAntlrKotlin}"),
project.dependencies.create("${Versions.antlrKotlinGroup}:antlr-kotlin-target:${Versions.antlrKotlin}")
project.dependencies.create(libs.orgAntlr.antlr4),
project.dependencies.create(libs.comStrumenta.antlrKotlinTarget)
)
maxHeapSize = "64m"
packageName = "kotlinx.ast.grammar.kotlin.target.antlr.kotlin.generated"
Expand Down
2 changes: 1 addition & 1 deletion grammar-kotlin-parser-antlr-optimized/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tasks.withType(Test::class.java).all {
}

dependencies {
antlr("com.tunnelvisionlabs:antlr4:${Versions.antlrOptimized}")
antlr(libs.comTunnelvisionlabs.antlr4)
api(project(":parser-antlr-optimized"))
api(project(":grammar-kotlin-parser-common"))
testImplementation(project(":grammar-kotlin-parser-test"))
Expand Down
2 changes: 1 addition & 1 deletion parser-antlr-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

dependencies {
api(project(":common"))
api("org.antlr:antlr4:${Versions.antlrJava}")
api(libs.orgAntlr.antlr4)
}

kotlin {
Expand Down
2 changes: 1 addition & 1 deletion parser-antlr-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kotlin {
val commonMain by getting {
dependencies {
api(project(":common"))
api("${Versions.antlrKotlinGroup}:antlr-kotlin-runtime:${Versions.antlrKotlin}")
api(libs.comStrumenta.antlrKotlinRuntime)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion parser-antlr-optimized/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
api(project(":parser-antlr-java")) {
exclude("org.antlr", "antlr4")
}
api("com.tunnelvisionlabs:antlr4:${Versions.antlrOptimized}")
api(libs.comTunnelvisionlabs.antlr4)
}

kotlin {
Expand Down

0 comments on commit a2a1f8a

Please sign in to comment.