-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (108 loc) · 3.99 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
/*
* pixi-plugin: build.gradle
*/
plugins {
id "java"
id "org.nrg.xnat.build.xnat-data-builder" version "1.9.1"
id "io.freefair.lombok" version "6.0.0-m2"
}
group "org.nrg.xnatx.plugins"
version "1.4.0"
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.9.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"
}
dependencies {
implementation 'org.projectlombok:lombok:1.18.24'
implementation 'javax.validation:validation-api:2.0.1.Final'
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-guava"
testImplementation "junit:junit"
testImplementation "com.h2database:h2"
testImplementation "org.hamcrest:hamcrest-library"
testImplementation 'org.mockito:mockito-core:4.8.0'
testImplementation "org.springframework:spring-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.springframework.security:spring-security-config"
testImplementation "org.springframework:spring-jdbc"
testImplementation "org.springframework:spring-orm"
testImplementation "org.apache.commons:commons-dbcp2"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
test {
useJUnit()
}
def buildDate = new Date()
// Pulls in GitHub Actions environment variables if available.
def github_actor = System.getenv().GITHUB_ACTOR ?: "Unknown"
def github_repo = System.getenv().GITHUB_REPOSITORY ?: "Unknown"
def github_sha = System.getenv().GITHUB_SHA ?: "Unknown"
def github_ref = System.getenv().GITHUB_REF ?: "Unknown"
logger.info("Building plugin: ${project.name} ${project.version} on ${buildDate}")
logger.info("GitHub actor: ${github_actor}")
logger.info("GitHub repository: ${github_repo}")
logger.info("GitHub SHA: ${github_sha}")
logger.info("GitHub ref: ${github_ref}")
ext.gitManifest = manifest {
attributes "Application-Name": "PIXI-PLUGIN",
"Build-Date": buildDate,
"GITHUB-ACTOR": github_actor,
"GITHUB-REPO": github_repo,
"GITHUB-SHA": github_sha,
"GITHUB-REF": github_ref
}
// 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')
}