-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
106 lines (86 loc) · 2.87 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
description = "ANTLR4 project template"
apply plugin: 'java'
apply plugin: 'com.bmuschko.nexus'
apply from: file('gradle/idea.gradle')
ext.versions = [
slf4j: "1.7.2",
logback: "1.0.9",
junit: "4.12",
antlr: '4.5.1'
]
ext.antlr = [
grammarpackage: "com.devsmart.microdb",
antlrSource: 'src/main/antlr',
destinationDir: "src/generated-sources/java"
]
configurations {
antlr4 {
description = "ANTLR4"
}
}
dependencies {
compile 'com.google.guava:guava:17.0'
compile 'com.squareup:javapoet:1.2.0'
compile 'commons-cli:commons-cli:1.3.1'
compile group: "org.slf4j", name: "slf4j-api", version: versions.slf4j
compile group: "ch.qos.logback", name: "logback-classic", version: versions.logback
compile group: "org.antlr", name: "antlr4-runtime", version: versions.antlr
antlr4 group: "org.antlr", name: "antlr4", version: versions.antlr
testCompile group: "junit", name: "junit", version: versions.junit
compile files("${System.properties['java.home']}/../lib/tools.jar") // This is needed otherwise compile-testing won't be able to find it
testCompile 'com.google.testing.compile:compile-testing:0.6'
compile project(':microdb-runtime')
}
tasks.withType(Test) {
systemProperties = System.getProperties()
testLogging.showStandardStreams = true
}
task antlrOutputDir << {
mkdir(antlr.destinationDir)
}
task generateGrammarSource(dependsOn: antlrOutputDir, type: JavaExec) {
description = 'Generates Java sources from ANTLR4 grammars.'
inputs.dir file(antlr.antlrSource)
outputs.dir file(antlr.destinationDir)
def grammars = fileTree(antlr.antlrSource).include('**/*.g4')
main = 'org.antlr.v4.Tool'
classpath = configurations.antlr4
def pkg = antlr.grammarpackage.replaceAll("\\.", "/")
args = ["-o", "${antlr.destinationDir}/${pkg}"/*, "-atn"*/, "-visitor", "-package", antlr.grammarpackage, grammars.files].flatten()
}
compileJava {
dependsOn generateGrammarSource
source antlr.destinationDir
}
clean {
delete antlr.destinationDir
}
compileJava {
targetCompatibility = 1.6
sourceCompatibility = 1.6
}
modifyPom {
project {
name 'microdb-generator'
description 'MicroDb DBO file generator'
url 'http://github.com/dinocore1/MicroDb'
scm {
url 'scm:git@github.com:dinocore1/MicroDb.git'
connection 'scm:git@github.com:dinocore1/MicroDb.git'
developerConnection 'scm:git@github.com:dinocore1/MicroDb.git'
}
licenses {
license {
name 'MIT License'
url 'https://github.com/dinocore1/MicroDb/blob/master/LICENSE.txt'
distribution 'repo'
}
}
developers {
developer {
id 'psoucy'
name 'Paul Soucy'
}
}
}
}