-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
125 lines (108 loc) · 3.61 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import org.gradle.internal.jvm.Jvm
plugins {
id 'java'
id 'checkstyle'
id 'findbugs'
id 'com.bmuschko.nexus' version '2.3.1'
id 'io.codearte.nexus-staging' version '0.8.0'
id 'com.github.johnrengelman.shadow' version '1.2.3'
}
group = 'com.imsweb'
version = file('VERSION').text
description = 'This library provides support for the NAACCR XML format.'
println "Starting build using ${Jvm.current()}"
repositories {
mavenCentral()
}
dependencies {
compile 'commons-io:commons-io:2.5'
compile 'org.apache.commons:commons-lang3:3.6'
compile 'com.thoughtworks.xstream:xstream:1.4.10'
compile 'javax.xml.bind:jaxb-api:2.3.0'
compile 'org.tukaani:xz:1.6'
testCompile 'junit:junit:4.12'
testCompile 'au.com.bytecode:opencsv:2.4'
testCompile 'com.imsweb:data-generator:1.2'
}
// enforce UTF-8 for all compilation tasks
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// customize the manifest
jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': version,
'Implementation-Vendor': 'Information Management Services Inc.',
'Created-By': System.properties['java.vm.version'] + ' (' + System.properties['java.vm.vendor'] + ')',
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': 'com.imsweb.naaccrxml.gui.Standalone')
}
from('VERSION') {
rename 'VERSION', 'NAACCR-XML-VERSION'
}
from('LICENSE') {
rename 'LICENSE', 'NAACCR-XML-LICENSE'
}
}
// this sucks, but they made the Javadoc way too stritct in Java 8 and it's not worth my time fixing it!
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
// we don't want these files in the "all" jar, it's confusing
shadowJar {
exclude('XMLPULL_1_1_3_1_VERSION')
exclude('XPP3_1.1.4c_MIN_VERSION')
from('VERSION') {
rename 'VERSION', 'NAACCR-XML-VERSION'
}
from('LICENSE') {
rename 'LICENSE', 'NAACCR-XML-LICENSE'
}
}
// checkstyle plugin settings
checkstyle {
ignoreFailures = true
configFile = file('config/checkstyle/checkstyle.xml')
}
// findbugs plugin settings
findbugs {
ignoreFailures = true
effort = 'max'
excludeFilter = file('config/findbugs/findbugs-exclude.xml')
}
// needed to deploy to Maven Central
modifyPom {
project {
name 'NAACCR XML'
description 'This library provides support for the NAACCR XML format.'
url 'https://github.com/imsweb/naaccr-xml'
inceptionYear '2015'
scm {
url 'https://github.com/imsweb/naaccr-xml'
connection 'scm:https://github.com/imsweb/naaccr-xml.git'
developerConnection 'scm:git@github.com:imsweb/naaccr-xml.git'
}
licenses {
license {
name 'A modified BSD License (BSD)'
url 'https://github.com/imsweb/naaccr-xml/blob/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'depryf'
name 'Fabian Depry'
email 'depryf@imsweb.com'
}
}
}
}
// don't try to release a snapshot to a non-snapshot repository, that won't work anyway
if (version.endsWith('-SNAPSHOT'))
gradle.startParameter.excludedTaskNames += 'closeAndReleaseRepository'
// Gradle wrapper, this allows to build the project without having to install Gradle...
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}