forked from roborescue/adf-core-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
95 lines (78 loc) · 2.23 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
plugins {
id 'java-library'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
version = '2.3.0'
repositories {
jcenter()
}
sourceSets {
main {
java {
srcDirs = [ 'src/main/java/adf' ]
}
}
}
def getDateTime() {
new Date().format('yyyyMMddHHmmss',TimeZone.getTimeZone('UTC'))
}
dependencies {
implementation fileTree(dir: new File(rootDir, 'lib'), include: '*.jar')
implementation fileTree(dir: new File(rootDir, 'lib/util'), include: '*.jar')
implementation fileTree(dir: new File(rootDir, 'lib/util/default'), include: '*.jar')
implementation fileTree(dir: new File(rootDir, 'lib/rescue/core'), include: '*.jar')
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
implementation 'com.sun.xml.bind:jaxb-core:2.3.0.1'
implementation 'com.sun.xml.bind:jaxb-impl:2.4.0-b180830.0438'
implementation 'javax.activation:activation:1.1.1'
testImplementation 'junit:junit:4.12'
}
[compileJava, compileTestJava].each {
it.options.encoding = 'UTF-8'
it.options.compilerArgs += [ '-Xlint:unchecked', '-Xlint:deprecation' ]
if (JavaVersion.current() == JavaVersion.VERSION_1_9) {
it.options.compilerArgs += [ '--add-modules', 'java.xml.bind',
'--add-exports','java.xml.bind/javax.xml.bind=ALL-UNNAMED' ]
}
}
javadoc.options.encoding = 'UTF-8'
if (JavaVersion.current() == JavaVersion.VERSION_1_9) {
javadoc.options.addStringOption('-add-modules', 'java.xml.bind');
}
test {
useJUnit()
}
jar {
manifest {
attributes "Main-Class": "adf.Main"
attributes "Build-Timestamp": getDateTime();
}
archiveName = 'adf-core.jar'
}
jar.doLast { task ->
ant.checksum file: task.archivePath
}
task javadocJar(type: Jar, dependsOn:javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
archiveName = 'adf-core-javadoc.jar'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
archiveName = 'adf-core-sources.jar'
}
artifacts {
archives sourcesJar
archives javadocJar
}
build.mustRunAfter 'clean'
task start (type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "adf.Main"
if (project.hasProperty('args')) {
args project.args.split('\\s+')
}
jvmArgs '-Xms512m', '-Xmx8g'
}