forked from NCIP/catissue-core
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathbuild.gradle
More file actions
392 lines (331 loc) · 17.4 KB
/
Copy pathbuild.gradle
File metadata and controls
392 lines (331 loc) · 17.4 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
import org.apache.tools.ant.filters.ReplaceTokens;
import org.gradle.api.tasks.Exec;
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'idea'
archivesBaseName = 'openspecimen'
Properties props = new Properties()
props.load(new FileInputStream("build.properties"))
def deploymentLocation = props.app_home + "/server/default/deploy"
if(new File(props.app_home + '/webapps').exists()) {
deploymentLocation = props.app_home + "/webapps"
}
project.ext["deploy_location"] = deploymentLocation
def environment = 'dev';
def envScript;
if (project.hasProperty("env")) {
environment = env
}
if (environment == 'prod') {
envScript = file("prod.gradle")
if (!envScript.exists()) {
throw new GradleException("Unknown environment: $env")
}
} else if (environment == 'test') {
envScript = file("test.gradle")
if (!envScript.exists()) {
throw new GradleException("Unknown environment: $env")
}
} else {
envScript = file("dev.gradle")
if (!envScript.exists()) {
throw new GradleException("Unknown environment: $env")
}
}
sourceSets {
main.java.srcDirs = ['WEB-INF/src']
main.resources.srcDirs = ['WEB-INF/resources']
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-parameters']
}
description = "openspecimen"
repositories {
mavenCentral()
maven {
url "https://build.shibboleth.net/nexus/content/repositories/releases/"
}
maven {
url "https://build.shibboleth.net/maven/releases/"
}
}
configurations {
ajc
aspects
aspectCompile
compile {
extendsFrom aspects
}
}
configurations.all {
transitive = false
}
dependencies {
ajc "org.aspectj:aspectjtools:1.9.19"
implementation "org.aspectj:aspectjrt:1.9.19"
aspects "org.springframework:spring-aspects:6.2.16"
implementation fileTree(dir: 'lib', include: ['os-dynamic-forms-trunk.jar', 'os-tinymce.jar'])
implementation group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: '3.2.0'
implementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '6.1.0'
implementation group: 'org.antlr', name: 'antlr4', version:'4.13.2'
implementation group: 'org.antlr', name: 'antlr4-runtime', version:'4.13.2'
implementation group: 'aopalliance', name: 'aopalliance', version:'1.0'
implementation group: 'asm', name: 'asm', version:'3.3.1'
implementation group: 'org.aspectj', name: 'aspectjweaver', version:'1.9.19'
implementation group: 'cglib', name: 'cglib', version:'3.1'
implementation group: 'commons-beanutils', name: 'commons-beanutils', version:'1.9.4'
implementation group: 'commons-codec', name: 'commons-codec', version:'1.15'
implementation group: 'commons-fileupload', name: 'commons-fileupload', version:'1.4'
implementation group: 'commons-httpclient', name: 'commons-httpclient', version:'3.1'
implementation group: 'commons-io', name: 'commons-io', version:'2.18.0'
implementation group: 'org.apache.commons', name: 'commons-collections4', version:'4.4'
implementation group: 'org.apache.commons', name: 'commons-digester3', version:'3.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version:'3.17.0'
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.27.1'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.15.0'
implementation group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: '1.2.5'
implementation group: 'org.apache.tika', name: 'tika-core', version: '3.3.1'
implementation group: 'org.apache.tika', name: 'tika-parsers-standard-package', version: '3.3.1'
implementation group: 'net.sf.kxml', name: 'kxml2-min', version:'2.3.0'
implementation group: 'net.sf.ehcache', name: 'ehcache', version:'1.2.3'
implementation group: 'net.sf.opencsv', name: 'opencsv', version:'2.3'
implementation group: 'com.google.code.gson', name: 'gson', version:'2.8.9'
implementation group: 'org.hibernate.common', name: 'hibernate-commons-annotations', version:'6.0.4.Final'
implementation group: 'org.hibernate.orm', name: 'hibernate-core', version:'7.2.4.Final'
implementation group: 'org.hibernate.orm', name: 'hibernate-envers', version:'7.2.4.Final'
implementation group: 'org.hibernate.models', name: 'hibernate-models', version: '1.0.1'
implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.17.8'
implementation group: 'com.fasterxml', name: 'classmate', version: '1.7.3'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.22'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.22.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.22.1'
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version:'2.22.1'
implementation group: 'org.javassist', name: 'javassist', version:'3.19.0-GA'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '4.0.6'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-core', version: '4.0.6'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '4.0.6'
implementation group: 'org.glassfish.jaxb', name: 'txw2', version: '4.0.6'
implementation group: 'com.sun.istack', name: 'istack-commons-runtime', version: '4.1.2'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version:'4.0.6'
implementation group: 'org.jboss.logging', name: 'jboss-logging', version:'3.6.1.Final'
implementation group: 'org.scijava', name: 'jep', version:'2.4.2'
implementation group: 'org.json', name: 'json', version:'20140107'
implementation group: 'jakarta.ws.rs', name: 'jakarta.ws.rs-api', version:'3.1.0'
implementation group: 'jakarta.transaction', name: 'jakarta.transaction-api', version:'2.0.1'
implementation group: 'com.sun.mail', name: 'jakarta.mail', version: '2.0.1'
implementation group: 'org.liquibase', name: 'liquibase-core', version:'4.8.0'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
implementation group: 'quartz', name: 'quartz', version:'1.5.2'
implementation group: 'org.springframework', name: 'spring-aspects', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-aop', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-beans', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-context', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-context-support', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-core', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-expression', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-instrument', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-jdbc', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-tx', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-web', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-webmvc', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-orm', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-messaging', version: '7.0.8'
implementation group: 'org.springframework', name: 'spring-jms', version: '7.0.8'
implementation group: 'org.springframework.integration', name: 'spring-integration-core', version: '7.0.5'
implementation group: 'org.springframework.integration', name: 'spring-integration-mail', version: '7.0.5'
implementation group: 'org.springframework.ldap', name: 'spring-ldap-core', version: '4.0.4'
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-config', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-core', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-ldap', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-web', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-oauth2-core', version: '7.0.6'
implementation group: 'org.springframework.security', name: 'spring-security-oauth2-jose', version: '7.0.6'
implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: '9.31'
implementation group: 'com.thoughtworks.xstream', name: 'xstream', version:'1.4.19'
implementation group: 'com.itextpdf', name: 'itextpdf', version:'5.5.13.2'
implementation group: 'dom4j', name: 'dom4j', version: '1.6.1'
implementation group: 'com.jcraft', name: 'jsch', version: '0.1.54'
implementation group: 'com.github.ua-parser', name: 'uap-java', version: '1.5.2'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.28'
implementation group: 'org.owasp.encoder', name: 'encoder', version: '1.2.3'
// HTML to PDF lib
implementation group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.24'
implementation group: 'org.apache.pdfbox', name: 'xmpbox', version: '2.0.24'
implementation group: 'org.apache.pdfbox', name: 'fontbox', version: '2.0.24'
implementation group: 'de.rototor.pdfbox', name: 'graphics2d', version: '0.32'
implementation group: 'com.openhtmltopdf', name: 'openhtmltopdf-core', version: '1.0.9'
implementation group: 'com.openhtmltopdf', name: 'openhtmltopdf-pdfbox', version: '1.0.9'
// Java APIs to access MS format files
implementation group: 'org.apache.poi', name: 'poi', version: '5.3.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.3.0'
implementation group: 'org.apache.poi', name: 'poi-ooxml-lite', version: '5.3.0'
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.2.2'
implementation group: 'com.google.zxing', name: 'core', version: '3.4.1'
implementation group: 'org.owasp.esapi', name: 'esapi', version: '2.2.0.0'
implementation group: 'xerces', name: 'xercesImpl', version: '2.12.2'
implementation group: 'xalan', name: 'xalan', version: '2.7.3'
implementation group: 'xalan', name: 'serializer', version: '2.7.3'
implementation group: 'joda-time', name: 'joda-time', version: '2.10'
implementation group: 'org.apache.velocity', name: 'velocity-engine-core', version:'2.3'
implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '2.1.2'
implementation group: 'org.eclipse.angus', name: 'angus-activation', version: '2.0.2'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.4'
implementation group: 'jakarta.inject', name: 'jakarta.inject-api', version: '2.0.1'
implementation group: 'org.jspecify', name: 'jspecify', version: '1.0.0'
// New SAML library
implementation group: 'org.springframework.security', name: 'spring-security-saml2-service-provider', version: '7.0.6'
implementation group: 'org.opensaml', name: 'opensaml-core-api', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-core-impl', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-saml-api', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-saml-impl', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-soap-api', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-soap-impl', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-xmlsec-api', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-xmlsec-impl', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-security-api', version: '5.1.6'
implementation group: 'org.opensaml', name: 'opensaml-security-impl', version: '5.1.6'
implementation group: 'net.shibboleth.utilities', name: 'java-support', version: '8.1.0'
implementation group: 'net.shibboleth', name: 'shib-support', version: '9.1.6'
implementation group: 'net.shibboleth', name: 'shib-security', version: '9.1.6'
implementation group: 'com.google.guava', name: 'guava', version: '33.0.0-jre'
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.2.37'
implementation group: 'org.cryptacular', name: 'cryptacular', version: '1.2.7'
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.16' // Core HTTP functionality
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: '5.4.1'
implementation group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: '5.2.5'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.84'
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: '1.84'
implementation group: 'org.bouncycastle', name: 'bcutil-jdk18on', version: '1.84'
implementation group: 'org.apache.santuario', name: 'xmlsec', version: '2.3.0'
implementation group: 'io.micrometer', name: 'micrometer-commons', version: '1.16.1'
implementation group: 'io.micrometer', name: 'micrometer-core', version: '1.16.1'
implementation group: 'io.micrometer', name: 'micrometer-observation', version: '1.16.1'
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.16.1'
implementation group: 'io.prometheus', name: 'prometheus-metrics-model', version: '1.3.1'
implementation group: 'io.prometheus', name: 'prometheus-metrics-core', version: '1.3.1'
implementation group: 'io.prometheus', name: 'prometheus-metrics-config', version: '1.3.1'
implementation group: 'io.prometheus', name: 'prometheus-metrics-exposition-formats', version: '1.3.1'
implementation group: 'io.prometheus', name: 'prometheus-metrics-shaded-protobuf', version: '1.3.1'
runtimeOnly group: 'antlr', name: 'antlr', version: '2.7.7'
runtimeOnly group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.16.0'
runtimeOnly group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '2.16.0'
testImplementation group: 'junit', name: 'junit', version:'4.13.1'
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
}
compileJava {
options.release = 17
afterEvaluate {
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:deprecation', '-Xmaxwarns', '10000', '-Xmaxerrs', '2000', '-parameters']
}
}
doLast{
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties",
classpath: configurations.ajc.asPath)
ant.iajc(
source: 17,
target: 17,
destDir: sourceSets.main.output.classesDirs.asPath,
maxmem: "512m",
fork: "true",
aspectPath: configurations.aspects.asPath,
sourceRootCopyFilter: "**/*.java",
classpath: "${configurations.compileClasspath.asPath};${configurations.aspectCompile.asPath}"){
sourceroots{
sourceSets.main.java.srcDirs.each{
pathelement(location:it.absolutePath)
}
}
}
}
}
def getTodayDate() {
def today = new Date()
return String.valueOf(today.getTime())
}
def getCommitRevision() {
def revCmd = "git rev-parse --short HEAD"
def revision = revCmd.execute()
return revision.text.trim()
}
def getBranch() {
def branchCmd = "git symbolic-ref -q --short HEAD";
def branch = branchCmd.execute().text.trim();
if (branch.length() == 0) {
branchCmd = "git describe --tags --exact-match";
branch = branchCmd.execute().text.trim();
}
return branch;
}
processResources {
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
from(sourceSets.main.resources.srcDirs) {
include 'application.properties'
filter(
ReplaceTokens,
tokens: [
buildinfo_version : getBranch(),
buildinfo_date : getTodayDate(),
buildinfo_commit_revision : getCommitRevision()])
}
}
task create_war(type: War) {
from ('./') {
include 'index.html'
include 'index-redirect.js'
}
from ('./WEB-INF/') {
include 'resources/**'
include 'applicationContext.xml'
include 'restApiContext.xml'
include 'pluginUiContext.xml'
include 'pluginVueUiContext.xml'
include 'migrationContext.xml'
include 'postInitContext.xml'
include 'web.xml'
into 'WEB-INF/'
}
from ('./build/') {
include 'form-designer/**'
}
from ('./ui/dist') {
include '**/**'
into 'ui-app/'
}
manifest {
attributes(
"Implementation-Title": archivesBaseName,
"Implementation-Version": getBranch(),
"Implementation-Timestamp": new Date()
)
}
}
task vue_backup_src(type: Exec) {
workingDir './ui'
commandLine 'mv', 'src', 'src_bk'
}
task vue_install_dependencies(type: Exec) {
workingDir './ui'
commandLine 'npm', 'install'
}
task vue_restore_src(type: Exec) {
workingDir './ui'
commandLine 'mv', 'src_bk', 'src'
}
task vue_build(type: Exec) {
workingDir './ui'
commandLine 'npm', 'run', 'build'
}
vue_install_dependencies.dependsOn vue_backup_src
vue_restore_src.dependsOn vue_install_dependencies
vue_build.dependsOn vue_restore_src
create_war.dependsOn vue_build
build.dependsOn create_war
apply from: envScript