-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
388 lines (345 loc) · 15.1 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
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
import org.apache.tools.ant.filters.ReplaceTokens
import nu.studer.gradle.jooq.JooqEdition
buildscript {
repositories {
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.grails.plugins:hibernate5:7.3.0" // This is different to gorm version
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion"
classpath "org.postgresql:postgresql:$postgresVersion" // for flyway
}
}
plugins {
id "org.flywaydb.flyway" version "9.6.0"
id 'nu.studer.jooq' version '7.2'
// Gradle Fix for Windows long paths (i.e. Java installed in Program Files/Java/...etc
id "com.virgo47.ClasspathJar" version "1.0.0"
id 'java'
id "com.dorongold.task-tree" version "2.1.1"
id "com.github.erdi.webdriver-binaries" version "3.2"
}
version "6.1.12-SNAPSHOT"
group "au.org.ala"
description "Digivol application"
sourceCompatibility = 1.11
targetCompatibility = 1.11
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.bertramlabs.asset-pipeline"
apply plugin:"org.grails.grails-gsp"
apply plugin:"maven-publish"
repositories {
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url "https://repo.grails.org/grails/core" }
maven {
url 'https://repo.maven.apache.org/maven2'
name 'Maven Central'
}
}
configurations {
developmentOnly
flywayMigration
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools:$springBootVersion")
implementation "org.springframework.boot:spring-boot-starter-logging:$springBootVersion"
implementation "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-tomcat:$springBootVersion"
implementation "org.grails:grails-web-boot"
implementation "org.grails:grails-logging"
implementation "org.grails:grails-plugin-rest"
implementation "org.grails:grails-plugin-databinding"
implementation "org.grails:grails-plugin-i18n"
implementation "org.grails:grails-plugin-services"
implementation "org.grails:grails-plugin-url-mappings"
implementation "org.grails:grails-plugin-interceptors"
implementation "org.grails.plugins:cache"
implementation "org.grails.plugins:async"
implementation "org.grails.plugins:scaffolding"
implementation "org.grails.plugins:events"
implementation "org.grails.plugins:hibernate5"
implementation "org.hibernate:hibernate-core:$hibernateVersion"
implementation "org.grails.plugins:gsp"
compileOnly "io.micronaut:micronaut-inject-groovy"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtimeOnly "org.glassfish.web:javax.el:2.2.6"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion"
runtimeOnly "org.springframework.boot:spring-boot-properties-migrator"
runtimeOnly 'org.codehaus.groovy:groovy-dateutil'
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails.plugins:geb"
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"
// Extra official Grails plugins
implementation "org.grails.plugins:converters"
implementation "org.grails:grails-async-gpars"
implementation "org.grails:grails-events-rxjava2"
implementation "org.grails.plugins:rxjava2:2.0.0"
implementation "org.codehaus.gpars:gpars:1.2.1" // Added for the GPars dependencies.
implementation "io.reactivex.rxjava2:rxjava:2.2.21"
implementation "org.grails:grails-datastore-gorm-async:${gormVersion}"
assets "com.bertramlabs.plugins:sass-dart-asset-pipeline:$assetPipelineVersion"
// Additional Plugins
implementation "org.hibernate:hibernate-ehcache:$hibernateVersion"
implementation "org.hibernate:hibernate-java8:$hibernateVersion"
implementation 'org.grails.plugins:cache-headers:2.0.2'
implementation 'org.grails.plugins:csv:1.0.ALA.3'
implementation 'org.grails.plugins:postgresql-extensions:6.1.0'
implementation 'org.grails.plugins:mail:3.0.0' //old: 2.0.1
implementation 'org.grails.plugins:grails-executor:0.4' // used in TaskLoadService.backgroundProcessQueue
implementation 'com.vladsch.flexmark:flexmark-all:0.64.8' // Markdown forum posts
implementation 'org.grails.plugins:grails-pretty-time:4.0.0' // may need modifications?
implementation("org.quartz-scheduler:quartz:2.3.2") {
exclude group: 'slf4j-api', module: 'c3p0'
}
implementation 'org.grails.plugins:quartz:2.0.13'
implementation 'org.grails.plugins:grails-google-visualization:2.2'
implementation 'dk.glasius:external-config:3.1.0'
implementation 'org.grails.plugins:cache-ehcache:3.0.0'
implementation 'org.ehcache:ehcache:3.4.0' // Prevent cache-ehcache dependent version being overridden
// These are needed for ehcache after jdk 11 removed JAXB completely.
// implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0'
// runtimeOnly 'com.sun.xml.bind:jaxb-impl:3.0.0'
// JAX-B dependencies for JDK 9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
// ALA Plugins
implementation "org.grails.plugins:ala-auth:$alaAuthVersion"
implementation 'au.org.ala:ala-cas-client:3.0.0'
implementation "au.org.ala:userdetails-service-client:$alaAuthVersion" // override this to for external properties changes
implementation "org.grails.plugins:ala-ws-security-plugin:$alaAuthVersion"
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20160526.1-ALA'
// Dependencies
runtimeOnly "org.postgresql:postgresql:$postgresVersion"
runtimeOnly "com.zaxxer:HikariCP:4.0.3"
runtimeOnly "org.slf4j:jul-to-slf4j:1.7.36"
runtimeOnly "org.slf4j:log4j-over-slf4j:1.7.36"
implementation "com.drewnoakes:metadata-extractor:2.18.0"
implementation 'org.imgscalr:imgscalr-lib:4.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.google.guava:guava:19.0'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.3' // old: 2.8.0
implementation 'org.apache.commons:commons-compress:1.11'
implementation 'org.apache.commons:commons-pool2:2.11.1' // old: 2.4.2
implementation group: 'commons-io', name: 'commons-io', version: '2.17.0' //''2.5'
implementation 'org.elasticsearch:elasticsearch:2.4.6'
// optional for elastic search, version should match elastic search optional dep
implementation group: 'org.apache.lucene', name: 'lucene-expressions', version: '4.9.1' //6.0.0 for ES 5.0, 8.11.1 for ES 7.17
implementation 'net.sf.opencsv:opencsv:2.3'
implementation 'org.freemarker:freemarker:2.3.31'
implementation group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version: '0.7.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// DB migrations, etc
// implementation 'org.jooq:jooq'
flywayMigration "org.postgresql:postgresql:$postgresVersion"
jooqGenerator "org.postgresql:postgresql:$postgresVersion"
implementation 'org.flywaydb:flyway-core:9.6.0'
implementation "org.jooq:jooq:$jooqVersion"
// For logback filter
implementation 'org.codehaus.janino:janino'
}
// Flyware/Jooq setup
def ci = System.env.CI == 'true'
def localProps = file("$project.rootDir/local.properties")
if (localProps.exists()) {
localProps.withReader {
def props = new Properties()
props.load(it)
project.ext.local = props
}
} else {
logger.error("No local.properties file found for flyway/jooq")
project.ext.local = new Properties()
}
flyway {
configurations = ['flywayMigration']
url = project.ext.local.flywayUrl
user = project.ext.local.flywayUsername
password = project.ext.local.flywayPassword
table = project.ext.local.flywayTable
baselineOnMigrate = project.ext.local.flywayBaselineOnMigrate?.toBoolean() ?: false
outOfOrder = project.ext.local.flywayOutOfOrder?.toBoolean() ?: false
}
jooq {
version = jooqVersion
edition = JooqEdition.OSS
configurations {
main {
generateSchemaSourceOnCompilation = true
generationTool {
logging = org.jooq.meta.jaxb.Logging.WARN
jdbc {
driver = 'org.postgresql.Driver'
url = project.ext.local.flywayUrl
user = project.ext.local.flywayUsername
password = project.ext.local.flywayPassword
properties {
property {
key = 'PAGE_SIZE'
value = 2048
}
}
}
generator {
name = 'org.jooq.codegen.DefaultGenerator'
database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'public'
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = true
fluentSetters = true
}
target {
packageName = 'au.org.ala.volunteer.jooq'
directory = 'build/generated-src/jooq/main'
}
strategy.name = "org.jooq.codegen.DefaultGeneratorStrategy"
}
}
}
}
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
bootJar { // Grails 4 replaces bootRepackage //
enabled = true
launchScript {
properties 'initInfoDescription': project.description,
initInfoShortDescription: project.name,
initInfoProvides: jar.baseName
} // executable = true
classifier = 'exec'
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
webdriverBinaries {
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
chromedriver {
version = '122.0.6260.0'
fallbackTo32Bit = true
}
geckodriver '0.33.0'
}
}
tasks.withType(Test) {
useJUnitPlatform()
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
systemProperty "java.locale.providers", "COMPAT,CLDR"
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}
tasks.named('generateJooq').configure {
// ensure database schema has been prepared by Flyway before generating the jOOQ sources
dependsOn tasks.named('flywayMigrate')
// declare Flyway migration scripts as inputs on the jOOQ task
inputs.files(fileTree('src/main/resources/db.migration'))
.withPropertyName('migrations')
.withPathSensitivity(PathSensitivity.RELATIVE)
// make jOOQ task participate in incremental builds (and build caching)
allInputsDeclared = true
}
assets {
minifyJs = true
minifyCss = true
enableSourceMaps = true
includes = ['tinymce/**/*', 'compile/**/*.ttf', 'compile/**/*.otf', 'compile/**/*.eot', 'compile/**/*.svg', 'compile/**/*.woff', 'compile/**/*.woff2', 'compile/**/*.png', 'compile/**/*.jpg', 'compile/**/*.gif']
excludes = ['compile/*', 'compile/**/*']
}
def gitSha() {
execOutput 'git rev-parse --short HEAD'
}
def gitTimestamp() {
execOutput 'git log -n 1 --format=%at'
}
def gitBranch() {
execOutput 'git rev-parse --abbrev-ref HEAD'
}
String execOutput(String exec) {
def p = exec.execute([], rootDir)
p.waitFor()
if (p.exitValue() != 0) {
final text = p.errorStream.text
logger.warn(text)
return text
}
return p.text.trim()
}
def envProp(String name, defaultValue = 'UNKNOWN' ) {
System.getenv(name) ?: System.getProperty(name) ?: (defaultValue instanceof Closure ? defaultValue() : defaultValue)?.toString()
}
processResources {
filesMatching("**/*.yml") {
filter(ReplaceTokens, tokens: [
'info.build.ci' : envProp('CI', 'false'),
'info.build.date' : new Date().toString(),
'info.build.jdk' : envProp('TRAVIS_JDK_VERSION', System.getProperty('java.version')),
'info.build.number' : envProp('TRAVIS_BUILD_NUMBER'),
'info.git.branch' : envProp('TRAVIS_BRANCH', { gitBranch() }),
'info.git.commit' : envProp('TRAVIS_COMMIT', { gitSha() }),
'info.git.slug' : envProp('TRAVIS_REPO_SLUG'),
'info.git.tag' : envProp('TRAVIS_TAG'),
'info.git.timestamp' : gitTimestamp()
])
}
}
publishing {
repositories {
maven {
name 'Nexus'
url "https://nexus.ala.org.au/content/repositories/${project.version.endsWith('-SNAPSHOT') ? 'snapshots' : 'releases' }"
credentials {
username = System.getenv('TRAVIS_DEPLOY_USERNAME')
password = System.getenv('TRAVIS_DEPLOY_PASSWORD')
}
}
}
publications {
mavenJar(MavenPublication) {
artifact bootJar
}
}
}