-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
68 lines (54 loc) · 1.73 KB
/
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
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
plugins {
id 'java'
id 'antlr'
}
group 'com.cjburkey'
version '0.0.1'
project.ext.antlrVersion = '4.7.2'
project.ext.fastUtilVersion = '8.2.2'
project.ext.log4jVersion = '2.11.1'
project.ext.junitVersion = '5.4.0'
project.ext.parserPackage = 'com.cjburkey.bullet.antlr'
sourceCompatibility = 11
sourceSets.main.java.srcDirs += ['generated-src/main/java', 'src/main/lang']
repositories {
mavenCentral()
}
dependencies {
antlr "org.antlr:antlr4:$antlrVersion"
implementation "it.unimi.dsi:fastutil:$fastUtilVersion"
implementation "org.apache.logging.log4j:log4j-core:$log4jVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
generateGrammarSource {
outputs.cacheIf { true }
source = 'src/main/lang'
arguments += ['-visitor', '-no-listener', '-package', parserPackage, '-Xexact-output-dir']
doLast {
println 'Copying generated grammar lexer/parser files to source'
mkdir 'generated-src/main/java'
copy {
from generateGrammarSource.outputDirectory.canonicalPath
into "generated-src/main/java/${parserPackage.replace('.', '/')}"
}
delete "$buildDir/generated-src/antlr"
}
}
compileJava {
options.warnings = true
options.deprecation = true
options.compilerArgs += ['-Xlint:all', '-Xlint:-processing', '-proc:none']
}
compileTestJava {
options.warnings = true
options.deprecation = true
options.compilerArgs += ['-Xlint:all', '-Xlint:-processing', '-proc:none']
}
task runCompiler(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.cjburkey.bullet.BulletCompiler'
}
test {
useJUnitPlatform()
}