This repository has been archived by the owner on Feb 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
/
build.gradle
206 lines (186 loc) · 8.08 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
import static org.opendatakit.aggregate.gradle.Util.getValue
import static org.opendatakit.aggregate.gradle.Util.getVersionName
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath "com.avast.gradle:gradle-docker-compose-plugin:0.6.8"
}
}
plugins {
id 'java'
id 'maven'
id 'war'
id 'idea'
id 'checkstyle'
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
apply plugin: 'gwt'
apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
apply plugin: 'docker-compose'
group = 'org.opendatakit'
version = getVersionName()
description = ""
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url = 'https://oss.sonatype.org/content/groups/public' }
flatDir {
dirs 'libs'
}
}
def versions = [
spring : '4.3.4.RELEASE',
springSecurity: '4.2.0.RELEASE',
gwt : [
servlet : '2.8.2',
googleMapsV3 : '1.0.1',
visualization: '1.1.2'
],
jackson : '2.8.5',
geronimo : '1.0',
httpcomponents: [
client: '4.5.2',
core : '4.4.5',
mime : '4.5.2'
],
commons : [
lang3 : '3.5',
fileUpload: '1.3.2',
dbcp2 : '2.1.1'
],
googleApi : [
client: '1.22.0',
sheets: 'v4-rev38-1.22.0',
drive : 'v3-rev52-1.22.0'
],
gson : '2.8.0',
kxml2 : '2.3.0',
odk : [
javarosa: '2.17.2'
],
jdbc : [
mysql : '5.1.44',
postgresql: '42.1.4.jre7'
],
servletApi : '3.1.0',
junit : '4.12',
mockito : '2.+'
]
configurations.all {
exclude group: 'commons-logging', module: 'commons-logging'
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25' // JCL over SLF4J
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.25'
compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.25'
compile group: 'org.springframework', name: 'spring-aop', version: versions.spring
compile group: 'org.springframework', name: 'spring-aspects', version: versions.spring
compile group: 'org.springframework', name: 'spring-beans', version: versions.spring
compile group: 'org.springframework', name: 'spring-context', version: versions.spring
compile group: 'org.springframework', name: 'spring-context-support', version: versions.spring
compile group: 'org.springframework', name: 'spring-core', version: versions.spring
compile group: 'org.springframework', name: 'spring-expression', version: versions.spring
compile group: 'org.springframework', name: 'spring-instrument', version: versions.spring
compile group: 'org.springframework', name: 'spring-jdbc', version: versions.spring
compile group: 'org.springframework', name: 'spring-tx', version: versions.spring
compile group: 'org.springframework', name: 'spring-instrument-tomcat', version: versions.spring
compile group: 'org.springframework', name: 'spring-web', version: versions.spring
compile group: 'org.springframework.security', name: 'spring-security-config', version: versions.springSecurity
compile group: 'org.springframework.security', name: 'spring-security-core', version: versions.springSecurity
compile group: 'org.springframework.security', name: 'spring-security-crypto', version: versions.springSecurity
compile group: 'org.springframework.security', name: 'spring-security-web', version: versions.springSecurity
compile group: 'com.googlecode.gwt-google-maps-v3', name: 'gwt-google-maps-v3', version: versions.gwt.googleMapsV3
compile group: 'com.google.gwt.google-apis', name: 'gwt-visualization', version: versions.gwt.visualization
compile group: 'com.google.gwt', name: 'gwt-servlet', version: versions.gwt.servlet
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: versions.jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: versions.jackson
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.jackson
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: versions.jackson
compile group: 'com.fasterxml.jackson.jaxrs', name: 'jackson-jaxrs-json-provider', version: versions.jackson
compile group: 'com.fasterxml.jackson.jaxrs', name: 'jackson-jaxrs-xml-provider', version: versions.jackson
compile group: 'org.apache.geronimo.specs', name: 'geronimo-jaxrs_1.1_spec', version: versions.geronimo
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: versions.httpcomponents.client
compile group: 'org.apache.httpcomponents', name: 'httpcore', version: versions.httpcomponents.core
compile group: 'org.apache.httpcomponents', name: 'httpmime', version: versions.httpcomponents.mime
compile group: 'org.apache.commons', name: 'commons-lang3', version: versions.commons.lang3
compile group: 'org.apache.commons', name: 'commons-dbcp2', version: versions.commons.dbcp2
compile group: 'commons-fileupload', name: 'commons-fileupload', version: versions.commons.fileUpload
compile group: 'com.google.api-client', name: 'google-api-client', version: versions.googleApi.client
compile group: 'com.google.api-client', name: 'google-api-client-appengine', version: versions.googleApi.client
compile group: 'com.google.apis', name: 'google-api-services-sheets', version: versions.googleApi.sheets
compile group: 'com.google.apis', name: 'google-api-services-drive', version: versions.googleApi.drive
compile group: 'com.google.code.gson', name: 'gson', version: versions.gson
compile group: 'net.sf.kxml', name: 'kxml2', version: versions.kxml2
compile group: 'org.getodk', name: 'javarosa', version: versions.odk.javarosa
compile group: 'mysql', name: 'mysql-connector-java', version: versions.jdbc.mysql
compile group: 'org.postgresql', name: 'postgresql', version: versions.jdbc.postgresql
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: versions.servletApi
testCompile group: 'junit', name: 'junit', version: versions.junit
testCompile group: 'org.springframework', name: 'spring-test', version: versions.spring
testCompile group: 'org.mockito', name: 'mockito-core', version: versions.mockito
}
gwt {
gwtVersion = versions.gwt.servlet
modules 'org.opendatakit.aggregate.AggregateUI'
minHeapSize = "512M"
maxHeapSize = "1024M"
}
war {
if (getValue(this, 'warMode', 'complete') == "installer") {
println "Excluding config files from WAR"
war.rootSpec.exclude "jdbc.properties"
war.rootSpec.exclude "logging.properties"
war.rootSpec.exclude "odk-common-security-settings.xml"
war.rootSpec.exclude "odk-security-settings.xml"
war.rootSpec.exclude "odk-settings.xml"
war.rootSpec.exclude "security.properties"
}
}
gretty {
contextPath = '/'
host = 'localhost'
logDir = 'logs'
}
buildConfig {
appName = 'ODK Aggregate'
version = getVersionName()
clsName = 'BuildConfig'
packageName = 'org.opendatakit.aggregate.buildconfig'
}
// Required to use fileExtensions property in checkstyle file
checkstyle {
toolVersion = '7.6.1'
}
dockerCompose {
postgresql {
useComposeFiles = ['db/postgresql/docker-compose.yml']
}
mysql {
useComposeFiles = ['db/mysql/docker-compose.yml']
}
}
task("checkConf") {
group = 'build'
description = 'Checks that all the conf files are present'
doLast {
def missingFiles = [
"jdbc.properties",
"security.properties",
"odk-settings.xml"
].findAll({ filename -> !new File("${projectDir}/src/main/resources/${filename}").exists() })
if (!missingFiles.isEmpty())
if(!project.gradle.startParameter.taskRequests.args[0].any{it.contains("docker")}){
throw new GradleException("Missing configuration files at src/main/resources: ${missingFiles}")
}
}
}
compileJava.dependsOn checkConf
apply from: 'installer.gradle'
apply from: 'packer.gradle'
apply from: 'docker-compose.gradle'
apply from: 'docker.gradle'