forked from NCIP/catissue-core
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathbuild.gradle
360 lines (299 loc) · 14 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
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
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']
}
description = "openspecimen"
repositories {
mavenCentral()
}
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:5.3.22"
implementation fileTree(dir: 'lib', include: ['os-dynamic-forms-trunk.jar', 'os-tinymce.jar'])
implementation group: 'javax.persistence', name: 'javax.persistence-api', version: '2.2'
implementation group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
implementation group: 'org.antlr', name: 'antlr4', version:'4.5.1'
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.11.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.12.0'
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.21'
implementation group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: '1.2.5'
implementation group: 'org.apache.tika', name: 'tika-core', version: '1.28.4'
implementation group: 'org.apache.tika', name: 'tika-parsers', version: '1.28.4'
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', name: 'hibernate-core', version:'5.6.11.Final'
implementation group: 'org.hibernate', name: 'hibernate-envers', version:'5.6.11.Final'
implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.8.22'
implementation group: 'com.fasterxml', name: 'classmate', version: '1.4.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.13.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.13.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.13.1'
implementation group: 'org.javassist', name: 'javassist', version:'3.19.0-GA'
implementation group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version:'2.3.0.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-xjc', version:'2.3.0.1'
implementation group: 'com.sun.xml.bind', name: 'jaxb-libs', version:'1.0.6'
implementation group: 'org.jboss.logging', name: 'jboss-logging', version:'3.3.2.Final'
implementation group: 'org.scijava', name: 'jep', version:'2.4.2'
implementation group: 'org.json', name: 'json', version:'20140107'
implementation group: 'javax.ws.rs', name: 'jsr311-api', version:'1.1.1'
implementation group: 'javax.transaction', name: 'jta', version:'1.1'
implementation group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'
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: '5.3.22'
implementation group: 'org.springframework', name: 'spring-aop', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-beans', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-context', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-context-support', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-core', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-expression', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-instrument', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-jdbc', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-tx', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-web', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-webmvc', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-orm', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-messaging', version: '5.3.22'
implementation group: 'org.springframework', name: 'spring-jms', version: '5.3.22'
implementation group: 'org.springframework.integration', name: 'spring-integration-core', version: '5.5.14'
implementation group: 'org.springframework.integration', name: 'spring-integration-mail', version: '5.5.14'
implementation group: 'org.springframework.ldap', name: 'spring-ldap-core', version: '2.4.1'
implementation group: 'org.springframework.security', name: 'spring-security-crypto', version: '5.7.3'
implementation group: 'org.springframework.security', name: 'spring-security-config', version: '5.7.3'
implementation group: 'org.springframework.security', name: 'spring-security-core', version: '5.7.3'
implementation group: 'org.springframework.security', name: 'spring-security-ldap', version: '5.7.3'
implementation group: 'org.springframework.security', name: 'spring-security-web', version: '5.7.3'
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-schemas', version: '4.1.2'
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.2.2'
implementation group: 'com.google.zxing', name: 'core', version: '3.4.1'
//SAML dependencies lib
implementation group: 'org.springframework.security.extensions', name: 'spring-security-saml2-core', version:'1.0.10.RELEASE'
implementation group: 'com.narupley', name: 'not-going-to-be-commons-ssl', version: '0.3.20'
implementation group: 'org.opensaml', name: 'opensaml', version: '2.6.4'
implementation group: 'org.opensaml', name: 'openws', version: '1.5.4'
implementation group: 'org.opensaml', name: 'xmltooling', version: '1.4.4'
implementation group: 'xml-security', name: 'xmlsec', version: '1.3.0'
implementation group: 'org.owasp.esapi', name: 'esapi', version: '2.1.0.1'
implementation group: 'xerces', name: 'xercesImpl', version: '2.12.2'
implementation group: 'xalan', name: 'xalan', version: '2.7.2'
implementation group: 'xalan', name: 'serializer', version: '2.7.2'
implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.71.1'
implementation group: 'joda-time', name: 'joda-time', version: '2.10'
implementation group: 'org.apache.velocity', name: 'velocity-engine-core', version:'2.3'
implementation group: 'com.sun.activation', name: 'javax.activation', version: '1.2.0'
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.3'
implementation group: 'com.sun.xml.bind', name: 'jaxb-ri', version: '2.3.3'
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'
}
compileJava {
options.release = 16
afterEvaluate {
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:deprecation', '-Xmaxwarns', '10000', '-Xmaxerrs', '2000']
}
}
doLast{
ant.taskdef(resource: "org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties",
classpath: configurations.ajc.asPath)
ant.iajc(
source: 16,
target: 16,
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 unzip_form_designer(type: Copy) {
def zipFile = file('./form-designer.zip')
def outputDir = file("${buildDir}/form-designer")
from zipTree(zipFile)
into outputDir
}
task create_war(type: War) {
from ('./') {
include 'ngweb/**'
}
from ('./www/dist/') {
include '**/**'
}
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()
)
}
}
def grunt_cmd = "grunt"
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
grunt_cmd = "grunt.cmd"
}
task grunt_build(type: Exec) {
workingDir './www'
commandLine grunt_cmd, 'build'
}
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 unzip_form_designer, grunt_build, vue_build
build.dependsOn create_war
apply from: envScript