-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle
97 lines (85 loc) · 2.72 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
group 'ca.waterloo.dsg'
version '0.1.0'
apply plugin: 'java'
apply plugin: 'antlr'
apply plugin: 'maven'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
}
dependencies {
antlr "org.antlr:antlr4:4.7"
compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
compile 'org.apache.logging.log4j:log4j-api:2.8.2'
compile 'org.apache.logging.log4j:log4j-core:2.8.2'
compile 'org.projectlombok:lombok:1.18.12'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:3.8.0'
testCompile 'org.mockito:mockito-core:2.9.0'
}
// ANTLR4 configuration.
generateGrammarSource {
maxHeapSize = "64m"
arguments += [
"-long-messages", // show exception details
"-visitor", // generate parse tree visitor classes
"-package", "ca.waterloo.dsg.graphflow.grammar" // specify package for generated classes
]
}
// Add the source files generated by ANTLR4 to the gradle sourcesets.
sourceSets.main.java.srcDirs += "$buildDir/generated-src/antlr/main"
compileJava {
sourceCompatibility = '11'
targetCompatibility = '11'
// Enable additional compile time warnings.
options.compilerArgs << "-Xlint:all" << "-Xlint:-processing" << "-Xlint:-cast" << "-Xlint:-serial"
// Enable incremental builds. Disable if giving errors.
options.incremental = true
}
apply plugin: 'application'
// Disable the default assembly tasks.
startScripts.enabled = false
run.enabled = false
distZip.enabled = false
distTar.enabled = false
// Create the executables.
def scripts = [
'dataset-serializer' : 'ca.waterloo.dsg.graphflow.runner.dataset.DatasetSerializer',
'catalog-serializer' : 'ca.waterloo.dsg.graphflow.runner.dataset.CatalogSerializer',
'optimizer-executor' : 'ca.waterloo.dsg.graphflow.runner.plan.OptimizerExecutor'
]
scripts.each() { fileName, className ->
tasks.create(name: fileName, type: CreateStartScripts) {
mainClassName = className
applicationName = fileName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into("bin") {
from(tasks[fileName])
fileMode = 0755
}
}
// Define specific gradle version.
task wrapper(type: Wrapper) {
gradleVersion = '4.8.1'
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
test {
testLogging {
events "skipped", "failed"
exceptionFormat "full"
}
}