-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
322 lines (298 loc) · 12.2 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
/*
* protocols: build.gradle
* XNAT http://www.xnat.org
* Copyright (c) 2017, Washington University School of Medicine
* All Rights Reserved
*
* Released under the Simplified BSD.
*/
import org.gradle.internal.jvm.Jvm
buildscript {
ext {
vXnatDev = '1.7.3-SNAPSHOT'
vXnat = '1.7.2'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-release'
name 'XNAT Release Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot'
name 'XNAT Snapshot Repository'
}
}
dependencies {
classpath "org.nrg.xnat.build:xnat-data-builder:${vXnatDev}"
}
configurations {
all*.exclude group: 'avalon-framework'
all*.exclude group: 'avalon-logkit'
all*.exclude group: 'com.metaparadigm'
all*.exclude group: 'com.sun.mail'
all*.exclude group: 'excalibur-component'
all*.exclude group: 'excalibur-instrument'
all*.exclude group: 'excalibur-logger'
all*.exclude group: 'excalibur-pool'
all*.exclude group: 'fop'
all*.exclude group: 'geronimo-spec'
all*.exclude group: 'hsqldb'
all*.exclude group: 'imagej'
all*.exclude group: 'jamon'
all*.exclude group: 'jakarta-regexp'
all*.exclude group: 'org.apache.geronimo.specs'
all*.exclude group: 'velocity'
all*.exclude group: 'xmlrpc'
all*.exclude group: 'ant', module: 'ant'
all*.exclude group: 'commons-email', module: 'commons-email'
all*.exclude group: 'edu.ucar', module: 'netcdf'
all*.exclude group: 'javax.jms', module: 'jms'
all*.exclude group: 'javax.mail', module: 'mail'
all*.exclude group: 'javax.servlet', module: 'servlet-api'
all*.exclude group: 'javax.sql', module: 'jdbc-stdext'
all*.exclude group: 'javax.transaction', module: 'jta'
all*.exclude group: 'jdbc', module: 'jdbc'
all*.exclude group: 'jms', module: 'jms'
all*.exclude group: 'jython', module: 'jython'
all*.exclude group: 'org.nrg', module: 'nrg'
all*.exclude group: 'net.sf.saxon', module: 'saxon'
all*.exclude group: 'stax', module: 'stax-api'
all*.exclude group: 'xml-apis', module: 'xml-apis'
all*.exclude module: 'commons-beanutils-core'
all*.exclude module: 'log4j-slf4j-impl'
all*.exclude module: 'pipelineCNDAXNAT'
all*.exclude module: 'slf4j-simple'
}
}
group 'org.nrg.xnat.protocol'
version '1.0.0-SNAPSHOT'
def vSpring = '4.2.9.RELEASE'
def vSpringSecurity = '4.0.4.RELEASE'
def vSwagger = '2.4.0'
def vJunit = '4.12'
def vServletApi = '3.1.0'
def vH2 = '1.4.191'
def vGroovy = '2.4.7'
def vLog4j = '1.2.17'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'eclipse'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url 'http://dcm4che.org/maven2'
name 'dcm4che Maven Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-release'
name 'XNAT Release Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot'
name 'XNAT Snapshot Repository'
}
maven {
url 'https://nrgxnat.jfrog.io/nrgxnat/ext-release'
name 'XNAT External Release Repository'
}
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
def javaVersion = Jvm.current().javaVersion
if (javaVersion.java8Compatible || javaVersion.java9Compatible) {
if (hasProperty("rt.17.jar")) {
// Solution for bootstrap classpath warning and possible issues with compatibility with 1.7 libraries
// was taken from this post on discuss.gradle.org: http://bit.ly/24xD9j0
def rt17jar = getProperty("rt.17.jar")
logger.info "Using ${rt17jar} as the bootstrap class path jar."
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.fork = true
options.compilerArgs << "-XDignore.symbol.file"
options.bootClasspath = rt17jar
}
}
} else {
logger.warn "No value was set for the rt.17.jar build property, but you are using a Java 8- or 9-compatible JDK. You should consider setting rt.17.jar to indicate a jar file containing the Java 1.7 run-time library:\n"
logger.warn "\n"
logger.warn " ./gradlew -Prt.17.jar=rt-1.7.0_45.jar war\n"
logger.warn "\n"
logger.warn "You can also set this property in a gradle.properties file, either in the top level of your build folder or in the folder ~/.gradle/:\n"
logger.warn "\n"
logger.warn " rt.17.jar=/home/developer/.gradle/rt.17.jar\n"
logger.warn "\n"
logger.warn "In some isolated instances, using a bootstrap library from a JDK version later than 1.7 can result in run-time errors.\n"
}
} else if (!javaVersion.java7Compatible) {
throw new BuildCancelledException("You are using a JDK version (${javaVersion}) that is not compatible with Java 7. The XNAT build will fail. Please install a JDK version of Java 7 or later.")
}
configurations {
all*.exclude group: 'avalon-framework'
all*.exclude group: 'avalon-logkit'
all*.exclude group: 'com.metaparadigm'
all*.exclude group: 'com.sun.mail'
all*.exclude group: 'excalibur-component'
all*.exclude group: 'excalibur-instrument'
all*.exclude group: 'excalibur-logger'
all*.exclude group: 'excalibur-pool'
all*.exclude group: 'fop'
all*.exclude group: 'geronimo-spec'
all*.exclude group: 'hsqldb'
all*.exclude group: 'imagej'
all*.exclude group: 'jamon'
all*.exclude group: 'jakarta-regexp'
all*.exclude group: 'org.apache.geronimo.specs'
all*.exclude group: 'velocity'
all*.exclude group: 'xmlrpc'
all*.exclude group: 'ant', module: 'ant'
all*.exclude group: 'commons-email', module: 'commons-email'
all*.exclude group: 'edu.ucar', module: 'netcdf'
all*.exclude group: 'javax.jms', module: 'jms'
all*.exclude group: 'javax.mail', module: 'mail'
all*.exclude group: 'javax.servlet', module: 'servlet-api'
all*.exclude group: 'javax.sql', module: 'jdbc-stdext'
all*.exclude group: 'javax.transaction', module: 'jta'
all*.exclude group: 'jdbc', module: 'jdbc'
all*.exclude group: 'jms', module: 'jms'
all*.exclude group: 'jython', module: 'jython'
all*.exclude group: 'org.nrg', module: 'nrg'
all*.exclude group: 'net.sf.saxon', module: 'saxon'
all*.exclude group: 'stax', module: 'stax-api'
all*.exclude group: 'xml-apis', module: 'xml-apis'
all*.exclude module: 'commons-beanutils-core'
all*.exclude module: 'log4j-slf4j-impl'
all*.exclude module: 'pipelineCNDAXNAT'
all*.exclude module: 'slf4j-simple'
}
// TODO: This tells the compiler where to find source code. This isn't required in a standard build,
// but the XNAT data builder generates code from XNAT data-type schemas that the compiler needs to know about.
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'build/xnat-generated/src/main/java'
}
resources {
srcDir 'src/main/resources'
srcDir 'build/xnat-generated/src/main/resources'
}
}
}
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
def root = asNode()
root.appendNode('name', 'XNAT Visits And Protocols Plugin')
root.appendNode('description', '')
root.appendNode('url', 'https://github.com/nrgxnat/protocols-plugin')
root.appendNode('inceptionYear', '2016')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/nrgxnat/protocols-plugin')
scm.appendNode('connection', 'scm:https://[email protected]/nrgxnat/protocols-plugin.git')
scm.appendNode('developerConnection', 'scm:https://[email protected]/nrgxnat/protocols-plugin.git')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'Simplified BSD 2-Clause License')
license.appendNode('url', 'http://xnat.org/about/license.php')
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def clevelandj = developers.appendNode('developer')
clevelandj.appendNode('id', 'clevelandj')
clevelandj.appendNode('name', 'Justin Cleveland')
clevelandj.appendNode('email', '[email protected]')
def rherrick = developers.appendNode('developer')
rherrick.appendNode('id', 'rherrick')
rherrick.appendNode('name', 'Rick Herrick')
rherrick.appendNode('email', '[email protected]')
}
}
}
repositories {
maven {
credentials {
// These properties must be set in the ~/.gradle/gradle.properties file or passed on the Gradle command
// line in the form -PrepoUsername=foo -PrepoPassword=bar.
username propertyWithDefault('repoUsername', 'username')
password propertyWithDefault('repoPassword', 'password')
}
if (project.version.endsWith('-SNAPSHOT')) {
url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot-local"
} else {
url "https://nrgxnat.jfrog.io/nrgxnat/libs-release-local"
}
}
}
}
def propertyWithDefault(String property, Object value) {
hasProperty(property) ? getProperty(property) : value
}
dependencies {
compile("org.nrg.xnat:web:${vXnatDev}") {
transitive = false
}
compile("org.nrg.xnat:xnat-data-models:${vXnatDev}") {
transitive = false
}
compile("org.nrg.xdat:core:${vXnatDev}") {
transitive = false
}
compile "org.nrg:notify:${vXnatDev}"
compile "org.nrg:prefs:${vXnatDev}"
compile "org.nrg:config:${vXnat}"
compile "org.nrg:framework:${vXnatDev}"
compile "org.reflections:reflections:0.9.10"
compile "javax.servlet:javax.servlet-api:3.1.0"
compile(group: 'turbine', name: 'turbine', version: '2.3.3') {
transitive = false
}
compile(group: 'org.apache.velocity', name: 'velocity', version: '1.7') {
transitive = false
}
compile(group: 'stratum', name: 'stratum', version: '1.0') {
transitive = false
}
compile(group: 'ecs', name: 'ecs', version: '1.4.2') {
transitive = false
}
compile "commons-fileupload:commons-fileupload:1.3.2"
compile "org.restlet:org.restlet:1.1.10"
compile "org.quartz-scheduler:quartz:2.2.2"
compile "org.springframework:spring-webmvc:${vSpring}"
compile "org.springframework:spring-context-support:${vSpring}"
compile "org.springframework:spring-context:${vSpring}"
compile "org.springframework.security:spring-security-acl:${vSpringSecurity}"
compile "org.springframework.security:spring-security-aspects:${vSpringSecurity}"
compile "org.springframework.security:spring-security-config:${vSpringSecurity}"
compile "org.springframework.security:spring-security-ldap:${vSpringSecurity}"
compile "org.springframework.security:spring-security-taglibs:${vSpringSecurity}"
compile "io.springfox:springfox-swagger2:${vSwagger}"
compile "io.springfox:springfox-swagger-ui:${vSwagger}"
compile "org.codehaus.groovy:groovy-all:${vGroovy}"
testCompile "junit:junit:${vJunit}"
testCompile "org.springframework:spring-test:${vSpring}"
testCompile "org.hamcrest:hamcrest-library:1.3"
testCompile "javax.servlet:javax.servlet-api:${vServletApi}"
testCompile "com.h2database:h2:${vH2}"
compile "log4j:log4j:${vLog4j}"
}