-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
45 lines (40 loc) · 961 Bytes
/
build.gradle
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
plugins {
id 'antlr'
}
repositories {
mavenCentral()
}
dependencies {
antlr "org.antlr:antlr4:4.9.2"
}
// grammars to include for checking
ext {
grammars = [
"FattyAcids.g4",
"GoslinFragments.g4",
"Goslin.g4",
"HMDB.g4",
"LipidMaps.g4",
"Shorthand2020.g4",
"SumFormula.g4",
"SwissLipids.g4",
// "Systematic.g4"
]
}
grammars.each {
def grammar = [it]
println "Checking '$it' with Antlr"
def taskName = "antlr-${it}"
def outputDir = "${project.buildDir}/generated-src/antlr/${it}" as File
def sourceDirectorySet = getObjects().sourceDirectorySet(it,it)
sourceDirectorySet.srcDir(".")
sourceDirectorySet.include(it)
outputDir.mkdirs()
tasks.create(name: taskName, type: AntlrTask) {
source = sourceDirectorySet
outputDirectory = outputDir
maxHeapSize = '1G'
arguments = []
}
tasks.named('compileJava') { dependsOn(taskName) }
}