-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle.kts
79 lines (64 loc) · 1.96 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
73
74
75
76
77
78
79
plugins {
id("antlr")
}
val kotlinVersion = extra["kotlinVersion"]
dependencies {
antlr(libs.antlr4Tool)
api(project(":core"))
api(project(":cli"))
api(project(":antlr4j"))
api(project(":ast"))
api("org.eclipse.emf:org.eclipse.emf.common:2.23.0")
api("org.eclipse.emf:org.eclipse.emf.ecore:2.25.0")
api("org.eclipse.emf:org.eclipse.emf.ecore.xmi:2.16.0")
api("org.eclipse.emfcloud:emfjson-jackson:2.0.0")
implementation("com.fasterxml.jackson.core:jackson-databind:2.14.1")
implementation(libs.gson)
api(libs.clikt)
testImplementation(libs.antlr4jRuntime)
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
}
fun Project.useAntlrInTests(packageName: String) {
tasks.generateTestGrammarSource {
maxHeapSize = "64m"
arguments = arguments + listOf("-package", packageName)
outputDirectory = File("generated-test-src/antlr/main/${packageName.replace('.', '/')}".toString())
}
sourceSets.getByName("test") {
java.srcDir("src/test/java")
java.srcDir("generated-test-src/antlr/main")
}
setAntlrTasksDeps()
}
project.useAntlrInTests("com.strumenta.simplelang")
tasks.clean {
delete("generated-src")
delete("generated-test-src")
}
idea {
module {
testSourceDirs = testSourceDirs + file("generated-test-src/antlr/main")
}
}
publishing {
addSonatypeRepo(project)
addPublication("kolasu_emf", "EMF integration for Kolasu", project)
}
signing {
sign(publishing.publications["kolasu_emf"])
}
tasks.named("sourcesJar") {
dependsOn("generateGrammarSource")
}
tasks.named("runKtlintCheckOverMainSourceSet") {
dependsOn("generateGrammarSource")
}
tasks.named("runKtlintCheckOverTestSourceSet") {
dependsOn("generateTestGrammarSource")
}
tasks.named("runKtlintFormatOverMainSourceSet") {
dependsOn("generateGrammarSource")
}
tasks.named("runKtlintFormatOverTestSourceSet") {
dependsOn("generateTestGrammarSource")
}