-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
112 lines (95 loc) · 2.73 KB
/
build.gradle
File metadata and controls
112 lines (95 loc) · 2.73 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
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
107
108
109
110
111
112
plugins {
id 'java'
id 'antlr'
id 'maven-publish'
id 'application'
}
group = 'ca.waterloo.dsg'
version = '0.1.0'
repositories {
mavenCentral()
}
dependencies {
antlr "org.antlr:antlr4:4.7"
implementation 'commons-cli:commons-cli:1.4'
implementation 'org.apache.logging.log4j:log4j-api:2.8.2'
implementation 'org.apache.logging.log4j:log4j-core:2.17.1'
implementation 'com.google.code.gson:gson:2.8.9'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.assertj:assertj-core:3.8.0'
testImplementation 'org.mockito:mockito-core:2.9.0'
}
// ANTLR4 configuration
tasks.withType(AntlrTask) {
maxHeapSize = "64m"
arguments += [
"-long-messages",
"-visitor",
"-package", "ca.waterloo.dsg.graphflow.grammar"
]
}
sourceSets {
main {
java {
srcDirs += "$buildDir/generated-src/antlr/main"
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType(JavaCompile) {
options.compilerArgs.addAll(["-Xlint:all", "-Xlint:-processing", "-Xlint:-cast", "-Xlint:-serial"])
}
application {
applicationDefaultJvmArgs = ["-Dfile.encoding=UTF-8"]
applicationName = "graphflow"
}
// Disable default distribution tasks
tasks.named("distZip").configure { enabled = false }
tasks.named("distTar").configure { enabled = false }
// Custom executable scripts
def scripts = [
'dataset-serializer': 'ca.waterloo.dsg.graphflow.runner.dataset.DatasetSerializer',
'catalog-serializer': 'ca.waterloo.dsg.graphflow.runner.dataset.CatalogSerializer',
'query-plan-generator': 'ca.waterloo.dsg.graphflow.runner.plan.QueryPlansGenerator',
'query-plan-executor': 'ca.waterloo.dsg.graphflow.runner.plan.QueryPlanSerExecutor',
]
scripts.each { fileName, className ->
tasks.create(name: fileName, type: CreateStartScripts) {
mainClassName = className
applicationName = fileName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + configurations.runtimeClasspath
}
applicationDistribution.into("bin") {
from(tasks[fileName])
fileMode = 0755
}
}
wrapper {
gradleVersion = '8.12'
distributionType = Wrapper.DistributionType.ALL
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier.set("sources")
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact tasks.sourceJar
}
}
}
tasks.test {
testLogging {
events "skipped", "failed"
exceptionFormat "full"
}
}
tasks.installDist {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}