-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (126 loc) · 4.64 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
/*
* pixi-plugin: build.gradle
*/
plugins {
id "java"
id "org.nrg.xnat.build.xnat-data-builder" version "1.8.6"
id "io.freefair.lombok" version "6.0.0-m2"
id "com.palantir.git-version" version "0.12.1"
}
group "org.nrg.xnatx.plugins"
version "0.2.0-SNAPSHOT"
description "PIXI Plugin for XNAT."
repositories {
mavenLocal()
maven { url "https://www.dcm4che.org/maven2" }
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-release" }
maven { url "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot" }
mavenCentral()
}
configurations {
implementation.extendsFrom(xnatProvided)
implementation.canBeResolved(true)
testImplementation.exclude group: 'org.slf4j', module: 'log4j-over-slf4j'
}
dependencies {
xnatProvided platform("org.nrg:parent:1.8.6.1")
xnatProvided "org.nrg:framework"
xnatProvided "org.nrg.xnat:xnat-data-models"
xnatProvided "org.nrg.xnat:web"
xnatProvided "org.nrg.xdat:core"
xnatProvided "org.nrg:dicom-xnat-mx"
xnatProvided "dcm4che:dcm4che-core"
xnatProvided "io.springfox:springfox-swagger2"
xnatProvided "io.springfox:springfox-swagger-ui"
implementation "com.twelvemonkeys.imageio:imageio-tiff:3.8.2"
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testImplementation "org.mockito:mockito-core:3.+"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnitPlatform()
}
// Pulls in the Jenkins BUILD_NUMBER environment variable if available.
def buildDate = new Date()
def buildNumber = System.getenv().BUILD_NUMBER?.toInteger() ?: "Manual"
def isDirty, branchName, gitHash, gitHashFull, commitDistance, lastTag, isCleanTag
try {
def gitDetails = versionDetails()
isDirty = gitVersion().endsWith ".dirty"
branchName = gitDetails.branchName ?: "Unknown"
gitHash = gitDetails.gitHash
gitHashFull = gitDetails.gitHashFull
commitDistance = gitDetails.commitDistance
lastTag = gitDetails.lastTag
isCleanTag = gitDetails.isCleanTag
} catch (IllegalArgumentException ignored) {
logger.info "Got an error trying to read VCS metadata from git. It's possible this project is not under VCS control. Using placeholder values for manifest entries."
isDirty = true
branchName = "Unknown"
gitHash = "None"
gitHashFull = "None"
commitDistance = 0
lastTag = "None"
isCleanTag = false
}
logger.info "Build-Date: ${buildDate}"
logger.info "Build-Number: ${buildNumber}"
logger.info "Implementation-Version: ${version}"
logger.info "Implementation-Sha-Full: ${gitHashFull}"
logger.info "Implementation-Sha: ${gitHash}"
logger.info "Implementation-Commit: ${commitDistance}"
logger.info "Implementation-LastTag: ${lastTag}"
logger.info "Implementation-Branch: ${branchName}"
logger.info "Implementation-CleanTag: ${isCleanTag}"
logger.info "Implementation-Dirty: ${isDirty}"
ext.gitManifest = manifest {
attributes "Application-Name": "PIXI-PLUGIN",
"Build-Date": buildDate,
"Build-Number": buildNumber,
"Implementation-Version": project.version,
"Implementation-Sha": gitHash,
"Implementation-Sha-Full": gitHashFull,
"Implementation-Commit": commitDistance,
"Implementation-LastTag": lastTag,
"Implementation-Branch": branchName,
"Implementation-CleanTag": isCleanTag,
"Implementation-Dirty": isDirty
}
// Configure the compileJava task to call the xnatDataBuilder task before trying to compile any
// Java code in the plugin. This is required for custom data types
compileJava.dependsOn project.tasks["xnatDataBuilder"]
// Not 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"
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
jar {
manifest = project.manifest {
from gitManifest
}
from {
(configurations.implementation - configurations.xnatProvided).collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
tasks.register('deploy-jar', Copy) {
description = "Copies the JAR file to a specified location. Requires the 'filePath' property to be set. Example: ./gradlew clean jar deploy-jar -PfilePath=/path/to/destination"
from jar
into project.findProperty('filePath')
}