-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
76 lines (63 loc) · 1.41 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
plugins {
id 'antlr'
id 'application'
}
repositories {
mavenCentral()
}
dependencies {
antlr "org.antlr:antlr4:4.10"
implementation "org.antlr:antlr4-runtime:4.10"
}
// exclude antlr, we only need its runtime in the dist.
configurations.implementation {
exclude group: "org.antlr", module: "antlr4"
}
generateGrammarSource {
outputDirectory = new File("${project.projectDir}/src/main/java/info/fulloo/trygve/parser")
}
application {
mainClass = "info.fulloo.trygve.editor.Main"
// enable assertions by default
applicationDefaultJvmArgs = ["-ea"]
}
build {
configure {
dependsOn generateGrammarSource
}
}
// make it executable
jar {
manifest {
attributes(
'Main-Class': "info.fulloo.trygve.editor.Main"
)
}
// If needed, a fat jar (all dependencies in one file) can be made like this:
// from {
// configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
//}
}
// default arguments for "gradlew run"
run {
args "-gui"
}
// include files into the final distribution
distZip {
into(project.name) {
from '.'
include 'examples/*'
include 'tests/*'
include 'LICENSE'
include 'doc/*'
}
}
distTar {
into(project.name) {
from '.'
include 'examples/*'
include 'tests/*'
include 'LICENSE'
include 'doc/*'
}
}