-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
161 lines (132 loc) · 5.66 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
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse'
ext {
tomcatContextPath = 'vascan'
}
apply from: "https://raw.githubusercontent.com/Canadensys/canadensys-common/master/gradle/canadensys_web_build_22.gradle"
import static groovy.io.FileType.FILES
//Make sure tomcat plugin will run with the right encoding
System.setProperty('file.encoding', 'UTF-8')
def group = 'canadensys.net'
// task use to generate the gradle wrapper files
task wrapper(type: Wrapper) {
gradleVersion = '2.1'
}
ext {
sourceEncoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
webCoreVersion = '0.9-SNAPSHOT'
webThemeVersion = '0.5-SNAPSHOT'
dataAccessVersion = '2.17.2'
dwcaReaderVersion = '1.20'
springVersion = '4.1.9.RELEASE'
hibernateVersion = '4.3.11.Final'
jacksonVersion = '2.8.11'
jacksonDataBindVersion = '2.8.11.3'
freemarkerVersion = '2.3.20'
freemarkerVersion = '2.3.21'
elasticSearchVersion = '0.90.12'
sitemeshVersion = '3.0.0'
h2Version = '1.4.190'
tomcatVersion = '7.0.59'
seleniumVersion = '2.44.0'
servletVersion = '3.1.0'
}
compileJava.options.encoding = sourceEncoding
compileTestJava.options.encoding = sourceEncoding
compileJava.sourceCompatibility = sourceCompatibility
compileJava.targetCompatibility = sourceCompatibility
repositories {
// switch back to mavenCentral() when on Java 8
maven { url "https://repo.maven.apache.org/maven2" }
mavenLocal()
maven {
url "https://repository.gbif.org/content/groups/gbif"
}
}
dependencies {
providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: servletVersion
compile group: 'net.canadensys', name: 'canadensys-data-access', version: dataAccessVersion
compile group: 'net.canadensys', name: 'canadensys-web-core', version: webCoreVersion
compile("net.canadensys:canadensys-webapp-core:${webCoreVersion}@war")
compile("net.canadensys:canadensys-web-theme:${webThemeVersion}@war")
compile group: 'org.gbif', name: 'dwca-reader', version: dwcaReaderVersion
compile group: 'org.freemarker', name: 'freemarker', version: freemarkerVersion
compile group: 'org.elasticsearch', name: 'elasticsearch', version: elasticSearchVersion
compile group: 'org.springframework', name: 'spring-webmvc', version: springVersion
compile group: 'org.springframework', name: 'spring-web', version: springVersion
compile group: 'org.springframework', name: 'spring-context-support', version: springVersion
compile group: 'org.springframework', name: 'spring-oxm', version: springVersion
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.25'
compile group: 'org.hibernate', name: 'hibernate-c3p0', version: hibernateVersion
compile group: 'org.apache.xmlgraphics',name:'batik-transcoder',version: '1.7'
compile group: 'org.apache.xmlgraphics',name:'batik-codec',version: '1.7'
compile group: 'commons-collections',name:'commons-collections',version:'3.2.2'
compile group: 'org.sitemesh', name: 'sitemesh', version: sitemeshVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonDataBindVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jacksonVersion
compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.2'
compile("org.gbif:name-parser:2.1"){
exclude module: 'slf4j-api'
}
//h2 is included to allow integration testing using a mock database
compile group: 'com.h2database', name: 'h2', version: h2Version
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.springframework', name: 'spring-test', version: springVersion
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testCompile group: 'com.jayway.jsonpath', name: 'json-path', version: '0.8.1'
testCompile group: 'org.seleniumhq.selenium', name :'selenium-java',version:seleniumVersion
testCompile group: 'org.seleniumhq.selenium', name :'selenium-firefox-driver',version:seleniumVersion
testCompile group: 'org.seleniumhq.selenium', name :'selenium-htmlunit-driver',version:seleniumVersion
tomcat("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
tomcat("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}")
}
//WAR plugin settings
war {
doFirst{
version = appVersion
}
from("${additionalWebFilesDir}/js"){
into("js")
include ("**/*.js")
}
from("${additionalWebFilesDir}/css"){
into("styles")
include ("*.css")
}
webInf { from "${buildDir}/config" }
excludes ['*.properties']
}
//Tomcat plugin settings
tomcatRunWar {
httpPort = tomcatHttpPort
contextPath = tomcatContextPath
stopKey = 'stopKey'
outputFile = file('tomcat.log')
}
//Used for conditional configuration. The configuration is applied only when we know that the task will be executed.
def onlyFor(task, config) {
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(task)) {
project.configure(project, config)
}
}
}
/**
* This task allows us to replace the data-source.xml with the one from 'config/local'.
*/
task useLocalDataSource{
//only include this configuration if 'copyLocalConfig' is in the task list
onlyFor(copyLocalConfig) {
if( file("config/local/data-source.xml").exists()){
war.excludes = ['WEB-INF/data-source.xml']
war.webInf { from 'config/local/data-source.xml' }
war.webInf { from 'src/test/resources/insert_test_data.sql' }
war.webInf { from 'src/test/resources/vascan_index_data.txt' }
}
}
}