-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
152 lines (138 loc) · 5.03 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
/*
* xnat-template: 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
// TODO: This block is required for the 'xnat-data-builder' plugin to function.
buildscript {
ext {
vXnat = '1.7.4'
}
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:${vXnat}"
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
}
}
// TODO: Change the group and version to values appropriate for your plugin project.
group 'edu.monash.xnat.plugins'
version '2.0.0'
// TODO: This is the minimum set of Gradle plugins required to build most XNAT plugins. You may include many others, including plugins for testing and test coverage, IDE integration, and more.
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'xnat-data-builder'
// TODO: This provides access to all of these repositories for dependency resolution.
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'
}
}
// TODO: As of the 1.7.x release, XNAT is built as a Java 7-compatible (i.e. JDK 1.7) application. All plugins must be 1.7 compatible as well.
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencyManagement.imports {
mavenBom "org.nrg:parent:${vXnat}"
}
// TODO: This is a pretty minimal set of dependencies, so don't worry if you need to add more.
dependencies {
implementation("org.nrg.xnat:web") {
transitive = false
}
implementation("org.nrg.xnat:xnat-data-models") {
transitive = false
}
implementation("org.nrg.xdat:core") {
transitive = false
}
implementation "org.nrg:prefs"
implementation "org.nrg:framework"
implementation("turbine:turbine") {
transitive = false
}
implementation("org.apache.velocity:velocity") {
transitive = false
}
implementation("stratum:stratum") {
transitive = false
}
implementation "log4j:log4j"
implementation "io.springfox:springfox-swagger2"
}
// TODO: If the compiler is Java 8 or later, this checks for a Java 7 version of the primary Java run-time library. Building with post-Java 7 libraries can result in occasional compatibility issues.
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 = property "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 as String
}
}
} else {
logger.warn "No value was set for the rt.17.jar build property, using the default bootstrap class path. You should consider setting rt.17.jar to indicate a jar file containing the Java 1.7 run-time library:\n"
logger.warn " ./gradlew -Prt.17.jar=rt-1.7.0_45.jar war\n"
}
}
// TODO: This configures the Jacoco test coverage plugin.
jacoco {
toolVersion = dependencyManagement.importedProperties["jacoco.version"]
}
jacocoTestReport {
reports {
xml.enabled = false
csv.enabled = false
html.destination file("${buildDir}/jacocoHtml")
}
}
// 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'
}
}
}