Skip to content

Commit f037ff1

Browse files
committed
Merge branch 'dev'
2 parents d142e03 + 15b0a20 commit f037ff1

File tree

307 files changed

+32146
-12552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+32146
-12552
lines changed

.gitignore

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
.idea/
2-
target/
1+
Thumbs.db
2+
.DS_Store
3+
.gradle
4+
build/
35
out/
6+
.idea
47
*.iml
5-
*.zip
6-
*.sha1
7-
plugin.xml
8-
*.log
9-
*.tld
10-
node_modules/
11-
.slcache
8+
*.ipr
9+
*.iws
10+
.project
11+
.settings
12+
.classpath
13+
.asscache

.travis.yml

+36-26
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,51 @@
1+
dist: xenial
12
language: groovy
2-
sudo: false
33
jdk:
44
- openjdk8
5+
6+
sudo: false
57
branches:
68
only:
79
- master
810
- dev
9-
- /^hotfix\/.*$/
1011
- /^feature\/.*$/
11-
- ecodata-client-plugin
12+
before_cache:
13+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
14+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
15+
cache:
16+
directories:
17+
- $HOME/.m2
18+
- $HOME/.gradle/caches/
19+
- $HOME/.gradle/wrapper/
20+
1221
before_install:
13-
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
14-
- git clone --depth=50 --branch=dev https://github.com/AtlasOfLivingAustralia/ecodata-client-plugin.git ../ecodata-client-plugin
15-
- rm -rf ~/.sdkman
16-
- curl -s get.sdkman.io > ~/install_sdkman.sh
17-
- chmod 775 ~/install_sdkman.sh
18-
- "~/install_sdkman.sh"
19-
- echo "sdkman_auto_answer=true" > ~/.sdkman/etc/config
20-
- source ~/.sdkman/bin/sdkman-init.sh
21-
- GRAILS_VERSION=`grep '^\s*app.grails.version' application.properties | sed -e 's/^\s*app\.grails\.version=//g'
22-
| tr -d "\r"`
23-
- echo "GRAILS_VERSION:$GRAILS_VERSION"
24-
- sdk install grails $GRAILS_VERSION || true
22+
- export TZ=Australia/Canberra
23+
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`)
24+
- git clone --depth=50 --branch=$ECODATA_CLIENT_PLUGIN_BRANCH https://github.com/AtlasOfLivingAustralia/ecodata-client-plugin.git ../ecodata-client-plugin
25+
26+
install:
27+
- cd ~/.nvm
28+
- source ~/.nvm/nvm.sh
29+
- nvm install $TRAVIS_NODE_VERSION
30+
2531
before_script:
26-
- mkdir -p ~/.grails; wget -q -O ~/.grails/settings.groovy https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_grails_settings_new.groovy
27-
- MAVEN_REPO="ala-repo-snapshot"; grep '^app\.version=' ./application.properties |
28-
grep -q "\-SNAPSHOT"; if [ "$?" = "1" ]; then MAVEN_REPO="ala-repo-release"; fi;
29-
- echo "MAVEN_REPO:$MAVEN_REPO"
30-
- node --version
31-
- npm install
32+
- cd $TRAVIS_BUILD_DIR
33+
- npm install
34+
3235
script:
33-
- node_modules/karma/bin/karma start karma.conf.js --single-run --browsers PhantomJS
34-
- grails clean && grails refresh-dependencies --non-interactive && grails test-app
35-
--non-interactive && grails prod maven-deploy --repository=$MAVEN_REPO --non-interactive
36-
--stacktrace
36+
- cd $TRAVIS_BUILD_DIR
37+
- ./gradlew clean && ./gradlew build
38+
- node_modules/karma/bin/karma start karma.conf.js --single-run --browsers ChromeHeadless
39+
40+
41+
after_success:
42+
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && travis_retry ./gradlew publish'
43+
44+
3745
env:
3846
global:
39-
- TRAVIS_NODE_VERSION="0.10"
47+
- TRAVIS_NODE_VERSION="10.8.0"
48+
- ECODATA_CLIENT_PLUGIN_BRANCH="feature/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JOhHpgFOTdejpZm8XIEOyakCImnJxLjTEivBIujfqT80esomN7rcEj0dulM8uOy1fi4FeyonMyR65ZwduPFaOop93CFSgw9aHlFyRh6Z0n0YNCRbuWLPPRt9ZjaLte7eEIlf87CmS0DDS1vCtKjoHN165K/gpBTltmVZDqBfT70BqVG+DIf3oBZW7scroSlcdJj18axyCIxsPibbCu4ezHgNpM84J2+f7BSaBvKuh00csvu5P0e3h3laHI6jzc0MkWWbV6ZB5e7ctG2fptXIZxse3X0I1tdgL3x08=
51+

README.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ New server side classes that are custom to Biocollect should be under the packag
1919
## General Information
2020

2121
### Technologies
22-
* Grails framework: 2.4.5
22+
* Grails framework: 3.3.11
23+
* Java 8
2324
* Knockout JS
2425
* JQuery
26+
* Gradle
27+
28+
29+
### Development Setup
30+
31+
* This project requires you to run the [ecodata project](https://github.com/AtlasOfLivingAustralia/ecodata) on port `8081`.
32+
33+
* [Use this guide to setup Biocollect in Intellij](setup.md)
2534

26-
### Setup
27-
* This project requires you to run the [ecodata project](https://github.com/AtlasOfLivingAustralia/ecodata) on port `8080`.
28-
* You will need the following local directories:
29-
```
30-
/data/biocollect/config
31-
/data/biocollect/images
32-
```
33-
* Add the external config file.
34-
* The app is expected to run in port 8087 locally. Just add the option `-Dserver.port=8087` to the run-app command:
35-
![Imgur](http://i.imgur.com/syIKPgy.png)
3635

3736
### Running Javascript automatic tests
3837
* Executing the tests requires node.js

_events.groovy

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import java.nio.file.Files
2+
import java.nio.file.Paths
3+
import java.nio.file.attribute.BasicFileAttributes
4+
import java.nio.file.attribute.FileTime
5+
import org.apache.commons.io.FileUtils
6+
7+
Boolean doesTemplateNeedCompiling (File templateDirectory, File compiledTemplateFile) {
8+
Boolean compile = false
9+
if (templateDirectory != null) {
10+
BasicFileAttributes attr = Files.readAttributes(Paths.get(compiledTemplateFile.canonicalPath), BasicFileAttributes.class)
11+
FileTime lastModifiedTime = attr.lastModifiedTime()
12+
def templateFiles = templateDirectory.listFiles()
13+
14+
for (templateFile in templateFiles) {
15+
BasicFileAttributes templateFileAttributes = Files.readAttributes(Paths.get(templateFile.canonicalPath), BasicFileAttributes.class)
16+
if (templateFileAttributes.lastModifiedTime().compareTo(lastModifiedTime) > 0 ) {
17+
return true
18+
}
19+
}
20+
}
21+
22+
return compile
23+
}
24+
25+
26+
void generateTemplateFile(File compiledTemplateFile, File templateDirectory) {
27+
if (!compiledTemplateFile.getParentFile().exists()) {
28+
compiledTemplateFile.getParentFile().mkdirs()
29+
}
30+
31+
FileUtils.writeStringToFile(compiledTemplateFile, '/* Do not edit or commit this file. This file built at compile by _Events.groovy */\n')
32+
def templates = templateDirectory.listFiles()
33+
templates.each { File template ->
34+
def fileParts = template.getName().split("\\.")
35+
if (fileParts.length >= 1) {
36+
def componentName = fileParts[0]
37+
38+
if (template.exists()) {
39+
def content = template.getText().replaceAll("[\n\r]", "")
40+
.replaceAll("\"", "\\\\\"")
41+
.replaceAll('\\s+', ' ')
42+
FileUtils.writeStringToFile(compiledTemplateFile,
43+
"componentService.setTemplate(\"${componentName}\", \"" + content + "\");" as String, true)
44+
}
45+
}
46+
}
47+
}
48+
49+
def buildTemplateFile(String templateDirectoryName, String compiledTemplateFileName) {
50+
File templateDir = new File(templateDirectoryName)
51+
File compiledTemplateFile = new File(compiledTemplateFileName)
52+
if (!compiledTemplateFile?.exists() || doesTemplateNeedCompiling(templateDir, compiledTemplateFile)) {
53+
generateTemplateFile(compiledTemplateFile, templateDir)
54+
}
55+
56+
}
57+
58+
buildTemplateFile("${projectDir}/grails-app/assets/components/template", "${projectDir}/grails-app/assets/components/compile/biocollect-templates.js")

application.properties

-5
This file was deleted.

build.gradle

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
import static org.springframework.boot.gradle.SpringBootPluginExtension.LayoutType.*
2+
3+
buildscript {
4+
repositories {
5+
mavenLocal()
6+
maven { url "https://repo.grails.org/grails/core" }
7+
maven { url "https://nexus.ala.org.au/content/groups/public/" }
8+
}
9+
dependencies {
10+
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
11+
//classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
12+
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
13+
}
14+
}
15+
16+
plugins {
17+
id 'war'
18+
}
19+
20+
version "5.0-SNAPSHOT"
21+
group "au.org.ala"
22+
23+
apply plugin:"eclipse"
24+
apply plugin:"idea"
25+
apply plugin:"war"
26+
apply plugin:"org.grails.grails-web"
27+
apply plugin:"asset-pipeline"
28+
apply plugin:"org.grails.grails-gsp"
29+
apply from: 'https://raw.githubusercontent.com/AtlasOfLivingAustralia/travis-build-configuration/master/travis_grails_publish.gradle'
30+
//apply plugin:"org.grails.grails-plugin-publish"
31+
32+
33+
repositories {
34+
mavenLocal()
35+
//for missing jai_core.jar
36+
// maven { url "http://download.osgeo.org/webdav/geotools"}
37+
maven { url "https://repo.grails.org/grails/core" }
38+
maven { url "https://nexus.ala.org.au/content/groups/public/" }
39+
mavenCentral()
40+
// maven { url "http://maven.geotoolkit.org"}
41+
42+
}
43+
44+
//def tomcatVersion = '7.0.55.2'
45+
def metadataExtractorVersion = "2.6.2"
46+
def imgscalrVersion = "4.2"
47+
def httpmimeVersion = "4.2.1"
48+
def jtsVersion = "1.8"
49+
def geoToolsVersion = "11.1"
50+
// Set to true it needed only for development
51+
boolean inplace = false
52+
53+
54+
dependencies {
55+
compile "org.springframework.boot:spring-boot-starter-logging"
56+
compile "org.springframework.boot:spring-boot-autoconfigure"
57+
compile "org.grails:grails-core"
58+
compile "org.springframework.boot:spring-boot-starter-actuator"
59+
compile "org.springframework.boot:spring-boot-starter-tomcat"
60+
61+
compile "org.grails:grails-dependencies"
62+
compile "org.grails:grails-logging"
63+
compile "org.grails:grails-web-boot"
64+
compile "org.grails:grails-plugin-i18n"
65+
compile "org.grails:grails-plugin-services"
66+
compile "org.grails:grails-plugin-url-mappings"
67+
compile "org.grails:grails-plugin-interceptors"
68+
compile "org.grails.plugins:cache"
69+
compile "org.grails.plugins:scaffolding"
70+
console "org.grails:grails-console"
71+
profile "org.grails.profiles:web"
72+
compile "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
73+
//runtime "com.h2database:h2"
74+
testCompile "org.grails:grails-plugin-testing"
75+
testCompile "org.grails.plugins:geb"
76+
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
77+
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
78+
compile "commons-io:commons-io:2.6"
79+
compile "com.drewnoakes:metadata-extractor:${metadataExtractorVersion}"
80+
compile "org.imgscalr:imgscalr-lib:${imgscalrVersion}"
81+
compile "org.apache.httpcomponents:httpmime:${httpmimeVersion}"
82+
compile "com.vividsolutions:jts:${jtsVersion}"
83+
//compile "org.geotools.xsd:gt-xsd-kml:${geoToolsVersion}"
84+
compile ("org.geotools.xsd:gt-xsd-kml:${geoToolsVersion}") {
85+
exclude group: 'javax.media', module: 'jai_core'
86+
}
87+
88+
compile "joda-time:joda-time:2.3"
89+
// compile "org.codehaus.groovy.modules.http-builder:http-builder:0.7.1"
90+
91+
// Used by the scripts
92+
compile ('org.grails.plugins:http-builder-helper:1.1.0') {
93+
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
94+
}
95+
96+
97+
// compile "org.grails:http-client"
98+
99+
// compile "org.apache.httpcomponents:httpcore:4.4.1"
100+
// compile "org.apache.httpcomponents:httpclient:4.4.1"
101+
compile "org.apache.httpcomponents:httpclient:4.5.7"
102+
103+
testCompile "org.grails:grails-test-mixins:3.3.0"
104+
testRuntime 'com.github.detro:phantomjsdriver:1.2.0'
105+
106+
//JSON converter
107+
//compile 'org.grails.plugins:converters'
108+
runtime 'org.webjars:jquery:1.12.4'
109+
//mimic grails.config.locations like in Grails 2.x
110+
compile 'org.grails.plugins:external-config:1.4.0'
111+
// compile 'org.grails.plugins:external-config:2.0.0.RC1'
112+
compile "org.grails.plugins:excel-import:3.0.2"
113+
compile "org.grails.plugins:excel-export:0.2.1"
114+
compile 'org.grails.plugins:grails-google-visualization:2.2.1'
115+
compile group: 'org.apache.poi', name: 'poi', version: '3.17'
116+
compile 'org.grails.plugins:mail:2.0.0.RC6'
117+
118+
119+
compile 'org.grails.plugins:grails-markdown:3.0.0'
120+
compile 'org.grails.plugins:grails-cookie:2.0.3'
121+
122+
compile 'org.grails.plugins:cache:5.0.0.RC1'
123+
124+
//ALA plugins
125+
//TODO Same namespace?
126+
compile ("au.org.ala.plugins.grails:images-client-plugin:1.2") {
127+
exclude group: 'commons-httpclient', module: 'commons-httpclient'
128+
}
129+
130+
// compile "au.org.ala.plugins.grails:images-client-plugin:0.9-SNAPSHOT"
131+
compile "org.grails.plugins:ala-auth:3.0.4"
132+
runtime "org.grails.plugins:ala-bootstrap3:3.0.4"
133+
compile "org.grails.plugins:ala-admin-plugin:2.1"
134+
if (!inplace) {
135+
compile "org.grails.plugins:ala-map-plugin:3.0"
136+
compile "org.grails.plugins:ecodata-client-plugin:3.0"
137+
}
138+
}
139+
140+
springBoot {
141+
buildInfo()
142+
layout = WAR
143+
}
144+
145+
146+
bootRun {
147+
jvmArgs('-Dspring.output.ansi.enabled=always', '-Xmx6000m')
148+
addResources = true
149+
}
150+
151+
bootRepackage {
152+
enabled = true
153+
executable = true
154+
classifier = 'exec'
155+
}
156+
157+
assets {
158+
minifyJs = true
159+
minifyCss = true
160+
161+
}
162+
163+
if (inplace) {
164+
grails {
165+
exploded = true
166+
plugins {
167+
compile (project(':ecodata-client-plugin'))
168+
compile (project(':ala-map-plugin'))
169+
}
170+
}
171+
172+
// Make ecodata-client-plugin _Events task is called
173+
assetCompile.dependsOn("ecodata-client-plugin:_Events")
174+
compileGroovy.dependsOn("ecodata-client-plugin:_Events")
175+
bootRun.dependsOn("ecodata-client-plugin:_Events")
176+
}
177+
178+
task _Events {
179+
doLast {
180+
println "Running biocollect _events.groovy script"
181+
println "${project.projectDir}/_events.groovy"
182+
new GroovyScriptEngine(["${project.projectDir}"] as String[]).run("_events.groovy", new Binding(['projectDir': project.projectDir]))
183+
}
184+
}
185+
186+
// the tasks used here for dependsOn may be incomplete/incorrect
187+
assetCompile.dependsOn(_Events)
188+
compileGroovy.dependsOn(_Events)
189+
bootRun.dependsOn(_Events)

gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
grailsVersion=3.3.11
2+
gormVersion=6.1.12.RELEASE
3+
gradleWrapperVersion=3.5

gradle/wrapper/gradle-wrapper.jar

51.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)