forked from AtlasOfLivingAustralia/volunteer-portal
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
260 lines (231 loc) · 8.87 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
import org.apache.tools.ant.filters.ReplaceTokens
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"}"
}
}
//plugins {
// id "com.moowork.node" version "1.1.1"
//}
version "4.0-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 plugin:"maven-publish"
ext{
grails {
pathingJar = true
}
}
/* Enable for doedat compilation*/
/*ext {
set "tomcat.version", "7.0.52" // use this to force a tomcat version
}*/
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
//}
dependencies {
// Grails 3.2.6
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-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
compile "org.hibernate:hibernate-core:5.1.3.Final"
compile "org.hibernate:hibernate-ehcache:5.1.3.Final"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:$assetPipelineVersion"
// runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testCompile "junit:junit-dep:4.10"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
compile "org.grails.plugins:grails-java8"
compile "org.grails.plugins:rxjava2:2.0.0"
compile "org.hibernate:hibernate-java8:5.1.3.Final"
// Additional Plugins
// compile 'org.grails.plugins:cache:3.0.3'
// compile 'org.grails.plugins:cache-headers:2.0.0.ALA-SNAPSHOT'
compile 'org.grails.plugins:csv:1.0.1'
// compile 'org.grails.plugins:postgresql-extensions:4.6.6' // check if needed
compile 'org.grails.plugins:mail:2.0.0.RC6'
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.9'
compile 'org.grails.plugins:grails-google-visualization:2.2'
// TODO ALA Plugins: image service (is it used anywhere?)
compile 'org.grails.plugins:ala-auth:3.0.2'
// TODO Collection Event Controller?
// BOOTSTRAP, FONT-AWESOME? NPM? Yarn? webjars ?
// compile 'org.webjars:bootstrap:3.3.7-1'
// compile 'org.webjars:angularjs:1.6.1'
// compile 'org.webjars:font-awesome:4.7.0'
// Dependencies
runtime 'org.postgresql:postgresql:42.1.1'
compile 'org.imgscalr:imgscalr-lib:4.2'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.google.guava:guava:19.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'
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
// addResources = true // enable for reloading src/main/resources when using gradle bootRun, disables processResources
}
bootRepackage {
enabled = true
executable = true
// classifier = 'exec'
embeddedLaunchScriptProperties = [
initInfoDescription: project.description,
initInfoShortDescription: project.name,
initInfoProvides: jar.baseName,
// mode: 'service'
]
}
assets {
minifyJs = true
minifyCss = true
includes = ['tinymce/**/*', 'compile/**/*.ttf', 'compile/**/*.otf', 'compile/**/*.eot', 'compile/**/*.svg', 'compile/**/*.woff', 'compile/**/*.woff2']
excludes = ['compile/*', 'compile/**/*', 'volunteer-portal/**']
// 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
}
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) {
pom.withXml {
def pomNode = asNode()
pomNode.dependencyManagement.replaceNode {}
// simply remove dependencies without a version
// version-less dependencies are handled with dependencyManagement
// see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
pomNode.dependencies.dependency.findAll {
it.version.text().isEmpty()
}.each {
it.replaceNode {}
}
}
// from components.web
}
}
}
//node {
// // Version of node to use.
// version = '6.9.4'
//
// // Version of npm to use.
// npmVersion = '3.10.10'
//
// // Version of Yarn to use.
// yarnVersion = '0.16.1'
//
// // Base URL for fetching node distributions (change if you have a mirror).
// distBaseUrl = 'https://nodejs.org/dist'
//
// // If true, it will download node using above parameters.
// // If false, it will try to use globally installed node.
// download = false
//
// // Set the work directory for unpacking node
// workDir = file("${project.buildDir}/nodejs")
//
// // Set the work directory for NPM
// npmWorkDir = file("${project.buildDir}/npm")
//
// // Set the work directory for Yarn
// yarnWorkDir = file("${project.buildDir}/yarn")
//
// // Set the work directory where node_modules should be located
// nodeModulesDir = file("${project.projectDir}/grails-app/assets")
//}