diff --git a/orx-jvm/orx-kotlin-parser/build.gradle b/orx-jvm/orx-kotlin-parser/build.gradle deleted file mode 100644 index f6808a02..00000000 --- a/orx-jvm/orx-kotlin-parser/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id("org.openrndr.extra.convention.kotlin-jvm") - id("antlr") -} - -sourceSets { - main { - java { - srcDir("build/generated-src/antlr") - } - } -} - -generateGrammarSource { - maxHeapSize = "64m" - arguments += ["-visitor", "-long-messages"] - outputDirectory = file("${project.buildDir}/generated-src/antlr/org/openrndr/extra/kotlin/antlr".toString()) -} - -dependencies { - antlr(libs.antlr.core) - implementation(libs.antlr.runtime) -} - -tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") -tasks.getByName("sourcesJar").dependsOn("generateGrammarSource") \ No newline at end of file diff --git a/orx-jvm/orx-kotlin-parser/build.gradle.kts b/orx-jvm/orx-kotlin-parser/build.gradle.kts new file mode 100644 index 00000000..ca45f3c6 --- /dev/null +++ b/orx-jvm/orx-kotlin-parser/build.gradle.kts @@ -0,0 +1,33 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + org.openrndr.extra.convention.`kotlin-jvm` + antlr +} + +tasks.generateGrammarSource { + maxHeapSize = "64m" + arguments.addAll(listOf("-visitor", "-long-messages", "-package", "org.openrndr.extra.kotlin.antlr")) + outputDirectory = file("${project.buildDir}/generated-src/antlr/org/openrndr/extra/kotlin/antlr".toString()) +} + +sourceSets { + main { + java { + srcDir("build/generated-src/antlr") + } + } +} + +tasks.withType { + kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") +} + +dependencies { + antlr(libs.antlr.core) + implementation(libs.antlr.runtime) + testImplementation(libs.kluent) +} + +tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") +tasks.getByName("sourcesJar").dependsOn("generateGrammarSource") diff --git a/orx-jvm/orx-kotlin-parser/src/main/antlr/KotlinParser.g4 b/orx-jvm/orx-kotlin-parser/src/main/antlr/KotlinParser.g4 index 6a15689c..53356a1f 100644 --- a/orx-jvm/orx-kotlin-parser/src/main/antlr/KotlinParser.g4 +++ b/orx-jvm/orx-kotlin-parser/src/main/antlr/KotlinParser.g4 @@ -4,11 +4,6 @@ parser grammar KotlinParser; -@header { -package org.openrndr.extra.kotlin.antlr; -} - - options { tokenVocab = KotlinLexer; } // SECTION: general diff --git a/orx-jvm/orx-kotlin-parser/src/main/antlr/UnicodeClasses.g4 b/orx-jvm/orx-kotlin-parser/src/main/antlr/UnicodeClasses.g4 index e11ccb9b..53728480 100644 --- a/orx-jvm/orx-kotlin-parser/src/main/antlr/UnicodeClasses.g4 +++ b/orx-jvm/orx-kotlin-parser/src/main/antlr/UnicodeClasses.g4 @@ -6,11 +6,6 @@ lexer grammar UnicodeClasses; -@header { -package org.openrndr.extra.kotlin.antlr; -} - - UNICODE_CLASS_LL: '\u0061'..'\u007A' | '\u00B5' |