-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
313 lines (267 loc) · 8.8 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
buildscript {
repositories {
maven {
url "https://repo.biocodellc.com/repository/maven-private/"
credentials {
username mavenUser
password mavenPass
}
}
mavenLocal()
}
dependencies {
classpath 'com.github.fgiannesini.libsass.gradle.plugin:libsass-gradle-plugin:+'
classpath "org.biocode:gradle-fims:1.3.2"
classpath ('com.google.javascript:closure-compiler:v20160208') {
exclude module: 'junit'
}
}
}
apply plugin: 'com.github.fgiannesini.libsass.gradle.plugin'
apply plugin: "org.biocode.fims-web"
import org.biocode.gradle.web.tasks.RestartRemoteJettyTask
import org.biocode.gradle.web.tasks.HotDeployRemoteJettyTask
ext.fimsCommonsVersion = "0.2.12"
fims {
maven {
username mavenUser
password mavenPass
}
}
repositories {
add(fims.mavenFims())
mavenLocal()
}
configurations {
querydslapt
}
// need to evaluate childProjects first so we can add the childProject server dependencies to the server configuration
evaluationDependsOnChildren()
ext.generatedSourceDir = file("src/main/generated")
idea {
module {
generatedSourceDirs += generatedSourceDir
}
}
sourceSets {
main {
java {
srcDirs += [generatedSourceDir]
}
}
}
dependencies {
server 'org.glassfish.jersey.media:jersey-media-multipart:2.25'
server('org.glassfish.jersey.ext:jersey-spring3:2.25') {
exclude module: 'bean-validator'
exclude module: 'asm-all-repackaged'
}
server 'javax.servlet:servlet-api:2.4'
server 'org.glassfish.jersey.media:jersey-media-json-jackson:2.25'
server 'com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.6.0'
server 'com.googlecode.json-simple:json-simple:1.1.1'
server 'org.springframework.data:spring-data-jpa:1.10.1.RELEASE'
server group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: '1.0.0.Final'
server 'org.slf4j:slf4j-log4j12:1.7.19'
server('org.apache.commons:commons-digester3:3.2') {
exclude module: 'asm'
}
server 'org.apache.poi:poi:3.10.1'
server 'org.apache.poi:poi-ooxml:3.10.1'
server 'commons-cli:commons-cli:1.2'
server group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
server group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile composite.resolveDependency("org.biocode:biocode-fims-commons:${fimsCommonsVersion}", "biocode-fims-commons")
server group: 'com.querydsl', name: 'querydsl-core', version: '4.1.2'
server group: 'com.querydsl', name: 'querydsl-jpa', version: '4.1.2'
querydslapt group: 'com.querydsl', name: 'querydsl-apt', version: '4.1.2'
serverRuntime group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.9'
server 'org.apache.commons:commons-dbcp2:2.1.1'
server 'mysql:mysql-connector-java:5.1.38'
server 'org.xerial:sqlite-jdbc:3.7.2'
server 'commons-validator:commons-validator:1.5.0'
server group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.8.11'
server 'org.hibernate:hibernate-entitymanager:5.1.0.Final'
server 'com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.8.4'
server group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.11'
server group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.2.11'
server group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.2.11'
server group: 'javax.activation', name: 'activation', version: '1.1.1'
server group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
server 'com.sun.mail:javax.mail:1.5.5'
server 'joda-time:joda-time:2.1' // TODO replace with java 8 Date/Times
testCompile "junit:junit-dep:4.10"
subprojects.each {
project.configurations.server.dependencies.addAll(it.configurations.server.dependencies)
project.configurations.serverRuntime.dependencies.addAll(it.configurations.serverRuntime.dependencies)
}
}
clean {
delete generatedSourceDir
}
//=================================
//= QueryDSL configuration
//=================================
task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') {
source = sourceSets.main.java
classpath = configurations.compile + configurations.querydslapt + configurations.server
options.compilerArgs = [
"-proc:only",
"-processor", "com.querydsl.apt.jpa.JPAAnnotationProcessor"
]
destinationDir = generatedSourceDir
}
//=============================
//= archive configuration
//=============================
war {
exclude "css/style.css"
webInf {
from("${buildDir}/css") {
into "/css/"
}
}
}
fatWar {
webInf {
from("${buildDir}/css") {
into "/css/"
}
}
}
//=============================
//= ssh configuration
//=============================
// jetty ssh plugin
remotes {
biscicol {
host = 'biscicol.org'
user = biscicolUser
password = biscicolPassword
}
}
compileJava {
dependsOn generateQueryDSL
source generateQueryDSL.destinationDir
options.forkOptions.executable = "${System.properties['java.home']}/../bin/javac"
}
//=============================
//= deployment configuration
//=============================
updateDependencies {
remote = remotes.biscicol
location = remoteLibsDirectory
}
updateDependenciesDev {
remote = remotes.biscicol
location = remoteDevLibsDirectory
}
deployFims {
remote = remotes.biscicol
remoteLibsDir = remoteLibsDirectory
remoteWarDir = remoteWarDirectory
}
deployFimsDev {
remote = remotes.biscicol
remoteLibsDir = remoteDevLibsDirectory
remoteWarDir = remoteWarDevDirectory
}
deployFimsLocal {
deployDir = localWarDirectory
}
task hotDeployFimsDev(type: HotDeployRemoteJettyTask, dependsOn: "deployFimsDev") {
group = 'Fims'
remoteWarDir = remoteWarDevDirectory
remote = remotes.biscicol
}
task hotDeployFims(type: HotDeployRemoteJettyTask, dependsOn: "deployFims") {
group = 'Fims'
remoteWarDir = remoteWarDirectory
remote = remotes.biscicol
}
task restartFims(type: RestartRemoteJettyTask) {
group = 'Fims'
jettyPath = biscicolJettyPath
remote = remotes.biscicol
}
task restartFimsDev(type: RestartRemoteJettyTask) {
group = 'Fims'
jettyPath = biscicolJettyDevPath
remote = remotes.biscicol
}
//===========================
//= js configuration
//===========================
// specify files that require a specific loading order
ext.externLibsOrdered = ["${webAppDir}/js/externalLibs/lodash.js", "${webAppDir}/js/externalLibs/papaparse.min.js",
"${webAppDir}/js/externalLibs/xlsx.min.js", "${webAppDir}/js/externalLibs/xlsx-reader.js"]
javascript.source {
externLibs {
js {
srcDir "src/main/web/js/externalLibs"
include "*.js"
// exclude any file that is in the externLibsOrdered list
exclude {
it.file in files(externLibsOrdered).files
}
exclude "autotrack.js"
}
}
app {
js {
srcDir "src/main/web/app"
include "**/*.js"
exclude "app.js"
exclude "app.module.js"
exclude "app.constants.js.template"
exclude "**/module.js"
exclude "**/*.module.js"
}
}
js {
js {
srcDir "src/main/web/js"
include "*.js"
exclude "fims-analytics.js"
}
}
modules {
js {
srcDir "src/main/web/app"
include "**/module.js"
include "**/*.module.js"
}
}
}
combineJs {
encoding = "UTF-8"
source = files("${webAppDirName}/app/app.module.js", javascript.source.modules.js.files, javascript.source.app.js.files, javascript.source.js.js.files)
dest = file("${webAppDirName}/js/all.js")
}
jsExternalLibs {
source = externLibsOrdered + javascript.source.externLibs.js.files
closure {
compilerOptions.language = "ECMASCRIPT5"
warningLevel = "QUIET"
}
}
jsApp {
source = files("src/main/web/app/app.module.js", javascript.source.modules.js.files, javascript.source.app.js.files, javascript.source.js.js.files)
closure {
compilerOptions.language = "ECMASCRIPT5"
}
}
//===========================
//= libsass configuration
//===========================
libSassParameters {
inputFilePath = "${projectDir}/src/stylesheets/sass/style.scss"
outputFilePath = "${buildDir}/css/style.css"
watchedDirectoryPath = "${projectDir}/src/stylesheets"
sourceMapEmbed = true
libSassProductionParameters {
outputStyle "compressed"
}
}
fatWar.dependsOn compileLibSassProduction
war.dependsOn compileLibSassProduction