forked from AtlasOfLivingAustralia/spatial-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
245 lines (210 loc) · 8.28 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
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://nexus.ala.org.au/content/groups/public/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.7"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.6"
// classpath 'com.bertramlabs.plugins:asset-pipeline-core:3.2.4'
}
}
version "2.0.0"
group "au.org.ala"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:"org.grails.grails-gsp"
//Angular assert wrapper needs
apply plugin:"com.bertramlabs.asset-pipeline"
apply plugin:"maven-publish"
war {
enabled=true
}
buildProperties {
inputs.property("info.app.build.date", new Date().format('yyyy-MM-dd HH:mm:ss'))
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://nexus.ala.org.au/content/groups/public/" }
maven { url 'https://jitpack.io' }
mavenCentral()
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
// compile "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-tomcat"
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:gsp"
implementation "io.micronaut:micronaut-inject-groovy"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtimeOnly "org.glassfish.web:el-impl:2.1.2-b03"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.0"
testImplementation "org.mockito:mockito-core"
testImplementation "org.grails:grails-web-testing-support"
testImplementation "org.grails.plugins:geb"
testRuntimeOnly 'net.sourceforge.htmlunit:htmlunit:2.35.0'
testImplementation "org.seleniumhq.selenium:htmlunit-driver:2.35.1"
testImplementation "org.seleniumhq.selenium:selenium-remote-driver:3.141.59"
testImplementation "org.seleniumhq.selenium:selenium-api:3.141.59"
testImplementation "org.seleniumhq.selenium:selenium-support:3.141.59"
testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:3.141.59"
testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"
// Additional Plugins
implementation 'dk.glasius:external-config:3.1.1'
implementation group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4'
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: "com.bertramlabs.plugins", name: "asset-pipeline-gradle", version: "3.4.6"
//Angular profile wrapper needs
assets 'com.craigburke.angular:angular-annotate-asset-pipeline:2.4.1'
//Fork version in Atlas
assets "com.craigburke.angular:angular-template-asset-pipeline:2.5.0"
implementation('com.github.ziplet:ziplet:2.0.0') {
exclude group: 'org.slf4j', module: 'slf4j-nop'
}
implementation "org.grails.plugins:ala-admin-plugin:2.3.0"
implementation "org.grails.plugins:ala-auth:6.0.0"
implementation "org.grails.plugins:ala-bootstrap3:4.1.0"
implementation "au.org.ala.plugins.grails:ala-charts-plugin:2.3.0-ANGULAR-SNAPSHOT"
runtimeOnly 'org.grails.plugins:sandbox-hub:1.0'
}
// Set to true it needed only for development
boolean inplace = false
if (inplace) {
grails {
exploded = true
plugins {
implementation (project(':ala-charts-plugin')) {
exclude group: 'org.grails', module: 'grails-plugin-converters'
}
}
}
}
task _Events {
doLast {
new GroovyScriptEngine([project.projectDir.toString()] as String[]).run('_Events.groovy', new Binding())
}
}
// the tasks used here for dependsOn may be incomplete/incorrect
assetCompile.dependsOn(_Events)
compileGroovy.dependsOn(_Events)
bootRun.dependsOn(_Events)
bootRun {
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions.forkOptions) {
memoryMaximumSize = '4g'
jvmArgs = ['-Xms2g', '-Xmx4g']
}
}
ext {
// The drivers we want to use
drivers = ["firefox", "chrome", "chromeHeadless"]
}
webdriverBinaries {
driverUrlsConfiguration = resources.text.fromFile('geb-repo-arm64.json') // (2)
chromedriver {
version = '101.0.4951.41'
architecture = 'ARM64'
}
geckodriver {
version = '0.31.0'
}
}
tasks.getByName("integrationTest") {
useJUnitPlatform()
description = 'Runs integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
group JavaBasePlugin.VERIFICATION_GROUP
systemProperty "geb.build.reportsDir", reporting.file("geb/$name")
systemProperty "geb.env", System.properties['driver']?:"firefox" // firefox by default
// pass test server by -DbaseUrl
systemProperty "geb.build.baseUrl", System.properties['baseUrl'] ?: "http://devt.ala.org.au:8087"
//Store username and password into the default config file
systemProperty "configFile",System.properties['configFile']?: "/data/spatial-hub/test/default.properties"
//or pass with -Dusername, -Dpassword
systemProperty "username", System.properties['username']
systemProperty "password", System.properties['password']
}
tasks.withType(Test) {
maxHeapSize = "1g"
jvmArgs '-XX:MaxMetaspaceSize=512m'
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
assets {
minifyJs = true
minifyCss = true
}
// Refer to FieldCapture: https://github.com/AtlasOfLivingAustralia/fieldcapture/blob/feature/grails4/gradle/publish.gradle
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 {
MavenPublication(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 {}
}
}
artifact bootWar
}
}
}