forked from crate/crate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
63 lines (49 loc) · 1.48 KB
/
Copy pathbuild.gradle
File metadata and controls
63 lines (49 loc) · 1.48 KB
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
apply from: "$rootDir/gradle/javaModule.gradle"
archivesBaseName = 'crate-sql-parser'
ext.antlr = [
source : "src/main/antlr",
output : "src/main/java/io/crate/sql/parser/antlr/v4",
package: 'io.crate.sql.parser.antlr.v4'
]
configurations {
antlr4
}
dependencies {
antlr4 "org.antlr:antlr4:${versions.antlr}"
compile "org.antlr:antlr4-runtime:${versions.antlr}"
compile "com.google.code.findbugs:jsr305:${versions.jsr305}"
compile "com.google.guava:guava:${versions.guava}"
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
testCompile "junit:junit:${versions.junit}"
}
task antlrOutputDir {
doLast {
mkdir(antlr.output)
}
}
task generateGrammarSource(dependsOn: antlrOutputDir, type: JavaExec) {
inputs.dir file(antlr.source)
outputs.dir file(antlr.output)
def grammars = fileTree(antlr.source).include('**/*.g4')
main = 'org.antlr.v4.Tool'
classpath = configurations.antlr4
args = ["-o", "${antlr.output}", "-visitor", "-package", antlr.package, grammars.files].flatten()
}
test {
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
testLogging.exceptionFormat = 'full'
jacoco {
excludes = [
"*Test*",
"TreeAssertions*",
"TreePrinter*"
]
}
}
tasks.withType(JavaCompile) {
it.dependsOn('generateGrammarSource')
}
clean {
delete antlr.output
}