-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle.backup.txt
313 lines (281 loc) · 11.7 KB
/
build.gradle.backup.txt
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
import org.apache.tools.ant.filters.ReplaceTokens
//import static org.springframework.boot.gradle.SpringBootPluginExtension.LayoutType.*
buildscript {
repositories {
mavenLocal()
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:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetPipelineVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "org.postgresql:postgresql:$postgresVersion" // for flyway
}
}
plugins {
id "org.flywaydb.flyway" version "4.2.0"
id 'nu.studer.jooq' version '3.0.3'
id 'pl.codelabs.flywayJooq' version '1.3.1'
// id "com.moowork.node" version "1.1.1"
// Gradle Fix for Windows long paths (i.e. Java installed in Program Files/Java/...etc
id "com.virgo47.ClasspathJar" version "1.0.0"
}
version "6.1.5-SNAPSHOT"
group "au.org.ala"
description "Digivol application"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
apply from: 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_grails_publish.gradle'
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 {
url = project.ext.local.flywayUrl
user = project.ext.local.flywayUsername
password = project.ext.local.flywayPassword
baselineOnMigrate = project.ext.local.flywayBaselineOnMigrate?.toBoolean() ?: false
outOfOrder = project.ext.local.flywayOutOfOrder?.toBoolean() ?: false
}
jooq {
// version = "${ext['jooq.version']}"
// edition = 'OSS'
volunteer(sourceSets.main) {
jdbc {
driver = 'org.postgresql.Driver'
url = project.ext.local.flywayUrl
user = project.ext.local.flywayUsername
password = project.ext.local.flywayPassword
}
generator {
name = 'org.jooq.codegen.JavaGenerator'
strategy {
name = 'org.jooq.codegen.DefaultGeneratorStrategy'
}
database {
name = 'org.jooq.meta.postgres.PostgresDatabase'
inputSchema = 'public'
forcedTypes {
forcedType {
userType = 'java.lang.Object'
binding = 'au.org.ala.volunteer.jooq.PostgresJSONMoshiBinding'
expression = '.*' // jooq 3.12 -> includeExpression
types = 'JSONB?' // jooq 3.12 -> includeTypes
}
}
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = true
fluentSetters = true
// ...
}
target {
packageName = 'au.org.ala.volunteer.jooq'
// directory = ...
}
}
}
}
generateVolunteerJooqSchemaSource.dependsOn flywayMigrate
// override spring boot dependency management versions here
ext {
// set "tomcat.version", "8.5.20" // use this to force a tomcat version
set "jooq.version", '3.12.4' // old: '3.11.9' - try 3.12 before going to 3.17.4
}
repositories {
mavenLocal()
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url "https://repo.grails.org/grails/core" }
jcenter()
}
// not in 3.2.7 by default?
//dependencyManagement {
// imports {
// mavenBom "org.grails:grails-bom:$grailsVersion"
// }
// applyMavenExclusions false
//}
// Spring boot developer tools - replaces spring loaded
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
// Grails 4.0.10
developmentOnly("org.springframework.boot:spring-boot-devtools")
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache:4.0.3"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
compile "org.hibernate:hibernate-core:$hibernateVersion"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "org.springframework.boot:spring-boot-properties-migrator"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails.plugins:geb:1.1.2"
testCompile "org.grails:grails-web-testing-support"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
testRuntime "org.seleniumhq.selenium:selenium-chrome-driver:2.47.1"
// Extra official Grails plugins
compile "org.grails.plugins:converters"
compile "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion"
assets "com.bertramlabs.plugins:sass-asset-pipeline:$assetPipelineVersion"
testCompile "org.grails:grails-test-mixins:3.3.0" // For legacy @TestMixin and @TestFor
compile "org.grails:grails-async-gpars"
compile "org.grails:grails-events-rxjava2"
compile "org.grails.plugins:grails-java8"
compile "org.grails.plugins:rxjava2:2.0.0"
compile "org.codehaus.gpars:gpars:1.2.1" // Added for the GPars dependencies.
compile "io.reactivex.rxjava2:rxjava:2.1.3"
compile "org.grails:grails-datastore-gorm-async:${gormVersion}"
// Extra Hibernate
compile "org.hibernate:hibernate-ehcache:$hibernateVersion"
compile "org.hibernate:hibernate-java8:$hibernateVersion"
// Additional Plugins
compile 'org.grails.plugins:cache-headers:2.0.2'
compile 'org.grails.plugins:csv:1.0.ALA.3'
compile 'org.grails.plugins:postgresql-extensions:6.1.0'
compile 'org.grails.plugins:mail:2.0.1'
compile 'org.grails.plugins:grails-executor:0.4' // used in TaskLoadService.backgroundProcessQueue
compile 'org.grails.plugins:grails-markdown:3.0.0' // may need modifications?
compile 'org.grails.plugins:grails-pretty-time:4.0.0' // may need modifications?
compile 'org.grails.plugins:quartz:2.0.12'
compile 'org.grails.plugins:grails-google-visualization:2.2'
compile 'org.grails.plugins:external-config:1.1.2'
// TODO ALA Plugins: image service (is it used anywhere?)
compile 'org.grails.plugins:ala-auth:3.2.3'
compile 'au.org.ala:userdetails-service-client:1.5.0' // override this to for external properties changes
compile 'org.grails.plugins:cache-ehcache:3.0.0'
compile 'org.ehcache:ehcache:3.4.0' // Prevent cache-ehcache dependent version being overridden
//compile 'org.grails.plugins:cache-ehcache:2.0.0.ALA'
// TODO Collection Event Controller?
// Dependencies
runtime "org.postgresql:postgresql:$postgresVersion"
runtime "com.zaxxer:HikariCP:4.0.3"
compile "com.drewnoakes:metadata-extractor:2.11.0"
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile 'com.squareup.retrofit2:converter-gson:2.4.0'
compile 'com.google.guava:guava:19.0'
compile 'com.github.ben-manes.caffeine:caffeine:2.8.0'
compile 'org.apache.commons:commons-compress:1.11'
compile 'org.apache.commons:commons-pool2:2.4.2'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile 'org.elasticsearch:elasticsearch:1.3.5'
// optional for elastic search, version should match elastic search optional dep
compile group: 'org.apache.lucene', name: 'lucene-expressions', version: '4.9.1'
compile 'net.sf.opencsv:opencsv:2.3'
compile 'org.freemarker:freemarker:2.3.23'
compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20160526.1-ALA'
compile group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version: '0.7.1'
// DB migrations, etc
compile 'org.jooq:jooq'
jooqRuntime "org.postgresql:postgresql:$postgresVersion"
compile "org.flywaydb:flyway-core:4.2.0"
// For logback filter
compile 'org.codehaus.janino:janino:3.1.7'
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always', '-Xmx6000m')
// sourceResources sourceSets.main // replaces addResources = true // enable for reloading src/main/resources when using gradle bootRun, disables processResources
}
springBoot {
layout = WAR
mainClass = 'au.org.ala.volunteer.Application'
}
bootJar { // Grails 4 replaces bootRepackage //
enabled = true
executable = true
classifier = 'exec'
embeddedLaunchScriptProperties = [
initInfoDescription: project.description,
initInfoShortDescription: project.name,
initInfoProvides: jar.baseName,
// mode: 'service'
]
}
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/**/*']
// excludes = ['codemirror/**/*.html', "**/*.min.js", "**/*.min.css", "angular/*/i18n/**", "**/*.map"]
// includes = ["fonts/*", "node_modules/*", "lib/*"]
// excludes = ["**/*.min.js", "**/*"]
}
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()
])
}
}
publish {
dependsOn assemble
}