-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
175 lines (158 loc) · 5.99 KB
/
build.gradle
File metadata and controls
175 lines (158 loc) · 5.99 KB
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
// 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.
plugins {
id "java"
id "io.spring.dependency-management" version "1.1.5"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "org.nrg.xnat.build.xnat-data-builder" version "1.8.10"
id "me.qoomon.git-versioning" version "6.4.2"
id "jacoco"
}
ext {
vXnat = "1.8.10"
junitJupiterVersion = "5.10.0"
mockitoVersion = "3.5.15"
jaxbVersion = "2.3.3"
}
// 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.icm.xnat.der"
version "1.0.0-SNAPSHOT"
description "Dicom-Edit Routing plugin for XNAT."
// As of the 1.8.x release, XNAT is built as a Java 8-compatible (i.e. JDK 1.8)
// application. All plugins must be 1.8 compatible as well. This does NOT mean
// the code must be compiled with Java 8, just that the compiled byte code must
// be compatible with running in a Java 8 environment.
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
gitVersioning.apply {
refs {
branch('.+') {
version = '${ref}-SNAPSHOT'
}
tag('^v?(?<version>\\d+\\.\\d+\\.\\d+)$') {
version = '${ref.version}'
}
}
// optional fallback configuration in case of no matching ref configuration
rev {
version = '${commit}'
}
}
// This generates a manifest file with VCS information for the plugin.
gitProperties {
keys = ['git.branch', 'git.commit.id', 'git.tags', 'git.commit.time']
}
// This provides access to all of these repositories for dependency resolution.
repositories {
mavenLocal()
mavenCentral()
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"
}
}
configurations {
all {
exclude group: "junit"
exclude group: "net.logstash.logback"
exclude group: "org.nrg.xnat.pipeline"
exclude group: "org.slf4j", module: "jcl-over-slf4j"
exclude group: "org.slf4j", module: "log4j-over-slf4j"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-simple"
}
implementation.extendsFrom(implementAndInclude)
}
// 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}"
}
}
// This is a pretty minimal set of dependencies, so don't worry if you need to add more.
dependencies {
compileOnly enforcedPlatform("org.nrg:parent:${vXnat}")
implementation("org.nrg.xnat:web") { transitive = false }
implementation("org.nrg:dicom-xnat-mx") { transitive = false }
implementation("org.nrg.xnat:xnat-data-models") { transitive = false }
implementation "org.nrg.xdat:core"
implementation "org.nrg:dicom-xnat-util"
implementation "org.nrg:dicomtools"
implementation "org.nrg.dicom:mizer"
implementation "org.nrg:prefs"
implementation "org.nrg:framework"
implementation "dcm4che:dcm4che-core"
implementation "io.springfox:springfox-swagger2"
implementation "io.springfox:springfox-swagger-ui"
implementation "jakarta.xml.bind:jakarta.xml.bind-api:${jaxbVersion}"
runtimeOnly "org.glassfish.jaxb:jaxb-runtime:${jaxbVersion}"
// Test dependencies
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.springframework:spring-test"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter"
testImplementation "org.assertj:assertj-core"
testImplementation "com.h2database:h2"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "ch.qos.logback:logback-classic"
}
// 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 {
srcDirs = ["src/main/java", "build/xnat-generated/src/main/java"]
}
resources {
srcDirs = ["src/main/resources", "build/xnat-generated/src/main/resources"]
}
}
}
jar {
archiveBaseName = rootProject.name
dependsOn compileJava
zip64 true
// files and folders with "-dev" or "--xx" in their name
// will not be in the compiled jar
exclude "**/resources/**/*-dev**"
exclude "**/resources/**/*--xx**"
from {
configurations.implementAndInclude.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
xnatBeanJar {
enabled = false
}
test {
useJUnitPlatform()
finalizedBy(jacocoTestReport)
}
jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/DicomEditRoutingPreferences.class',
'**/DicomEditRoutingPlugin.class'])}))
}
}
compileJava.dependsOn project.tasks["xnatDataBuilder"]