This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
114 lines (103 loc) · 4.68 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
/*
* xnat-template: build.gradle
* XNAT http://www.xnat.org
* Copyright (c) 2020, 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.6"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
gradlePluginPortal()
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-release" }
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot" }
}
dependencies {
classpath "org.nrg.xnat.build:xnat-data-builder:${vXnat}"
classpath "io.franzbecker:gradle-lombok:3.3.0"
classpath "io.spring.gradle:dependency-management-plugin:1.0.11.RELEASE"
}
}
// TODO: Change the group and version to values appropriate for your plugin project.
// NOTE: You should not leave the group value set to "org.nrg.xnatx.plugins"! Use
// something to indicate who developed the plugin and follow the standard
// Maven naming conventions: https://maven.apache.org/guides/mini/guide-naming-conventions.html
// For example, if a group at Miskatonic University developed a plugin, the
// group might be "edu.miskatonic.imaging.xnat".
group "org.snet.xnat.plugins"
version "0.2.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: "java"
apply plugin: "xnat-data-builder"
apply plugin: "io.franzbecker.gradle-lombok"
apply plugin: "io.spring.dependency-management"
// TODO: This provides access to all of these repositories for dependency resolution.
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-release" }
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot" }
}
// 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
// TODO: This defines a dependency package, specifically the XNAT NRG parent pom, which specifies
// versions for all of XNAT's dependencies. This helps ensure that plugins are building
// against the same versions of various libraries as XNAT itself.
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"
implementation "org.nrg.xnat:xnat-data-models"
implementation "org.nrg.xdat:core"
implementation "io.springfox:springfox-swagger2"
implementation "io.springfox:springfox-swagger-ui"
}
lombok {
version = dependencyManagement.importedProperties["lombok.version"] as String
sha256 = dependencyManagement.importedProperties["lombok.checksum"] as String
}
// 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.bootstrapClasspath = files(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 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"
}
}
}