Skip to content

Commit

Permalink
chore: 🤖 add antlr plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanonymous-GitHub committed Jul 15, 2024
1 parent 29a94e1 commit 9e64bb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.kotlinJvm)
application
antlr
}

group = "tw.xcc.gumtree"
Expand All @@ -14,14 +15,28 @@ application {
}

dependencies {
antlr(libs.antlr)
implementation(libs.logback)

// Test dependencies
testImplementation(libs.kotlin.test)
testImplementation(libs.kotlin.test.junit5)
}

internal val projectRootLocation: String = layout.projectDirectory.toString()
internal val forcedAntlrPackageName = "$group.model.lang"
internal val antlrGenFilesLocation =
file(
"$projectRootLocation/src/main/java/" +
forcedAntlrPackageName.replace('.', '/')
)

tasks {
generateGrammarSource {
outputDirectory = antlrGenFilesLocation
arguments = listOf("-package", forcedAntlrPackageName)
}

test {
useJUnitPlatform()
}
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
kotlin = "2.0.0"
logback = "1.5.6"
gradle-ktlint = "12.1.1"
antlr = "4.13.1"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
antlr = { group = "org.antlr", name = "antlr4-runtime", version.ref = "antlr" }

[plugins]
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand Down

0 comments on commit 9e64bb4

Please sign in to comment.