-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
73 lines (60 loc) · 1.63 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.maven.publish)
alias(libs.plugins.kover)
antlr
}
group = "io.github.yamilmedina"
version = findProperty("VERSION_NAME") as String
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
antlr(libs.antlr.antlr4)
implementation(libs.antlr.runtime)
testImplementation(libs.kotlin.test)
testImplementation(libs.junit.params)
}
sourceSets {
main {
java.srcDir(file("${project.layout.buildDirectory.get()}/generated/antlr/"))
kotlin.srcDir(file("${project.layout.buildDirectory.get()}/generated/antlr/"))
}
}
tasks.apply {
generateGrammarSource {
maxHeapSize = "64m"
arguments = arguments + listOf("-visitor", "-long-messages")
arguments = arguments + listOf("-package", "io.github.yamilmedina.kron.internal.antlr")
outputDirectory =
file("${project.layout.buildDirectory.get()}/generated/antlr/io/github/yamilmedina/kron/internal/antlr")
}
test {
useJUnitPlatform()
}
compileTestKotlin {
dependsOn(generateTestGrammarSource)
}
compileKotlin {
dependsOn(generateGrammarSource)
}
kotlinSourcesJar {
dependsOn(generateGrammarSource)
}
}
kotlin {
jvmToolchain(8)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
afterEvaluate {
mavenPublishing {
var isRelease: Boolean by extra { getEnvOrLocalProperty("IS_RELEASE", "false") == "true" }
if (findProperty("isRelease") == true) {
signAllPublications()
}
}
}