/
common.gradle
291 lines (247 loc) · 9.61 KB
/
common.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.filters.ReplaceTokens
configurations {
sshAntTask
}
dependencies {
sshAntTask 'org.apache.ant:ant-jsch:1.10.5', 'com.jcraft:jsch:0.1.55'
}
allprojects {
apply plugin: 'eclipse'
group = 'org.jumpmind.symmetric'
repositories {
jcenter()
maven { url "http://maven.jumpmind.com/repo" }
mavenCentral()
maven { url "http://maven.vaadin.com/vaadin-addons" }
maven { url 'https://plugins.gradle.org/m2' }
maven { url "http://packages.confluent.io/maven/" }
maven { url "https://repository.mulesoft.org/nexus/content/repositories/public/" }
}
ext {
majorMinorVersion = version.substring(0, version.indexOf(".", version.indexOf(".")+ 1))
}
}
def ignoreDerivedResources(projectDescription, directories = ["build", "test-output"]) {
def count = directories.count { file(it).exists() }
if (count > 0) {
def filter = projectDescription
.appendNode("filteredResources")
.appendNode("filter")
filter.appendNode("id", System.currentTimeMillis().toString().trim())
filter.appendNode("type", "26")
filter.appendNode("name")
def matcher = filter.appendNode("matcher")
matcher.appendNode("id", "org.eclipse.ui.ide.orFilterMatcher")
def arguments = matcher.appendNode("arguments")
directories.each {
if (file(it).exists()) {
def dirMatcher = arguments.appendNode("matcher")
dirMatcher.appendNode("id", "org.eclipse.ui.ide.multiFilter")
dirMatcher.appendNode("arguments", "1.0-projectRelativePath-matches-false-false-${it}")
}
}
}
}
subprojects { subproject ->
apply plugin:'license-report'
apply plugin: 'java'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'propdeps-eclipse'
apply plugin: 'maven'
configurations { deployerJars }
configurations { testArtifacts.extendsFrom testRuntime }
configurations.provided.transitive = true
configurations.optional.transitive = false
sourceCompatibility=1.8
targetCompatibility=1.8
compileJava {
options.compilerArgs += '-Xlint:deprecation'
}
compileTestJava {
options.compilerArgs += '-Xlint:deprecation'
}
eclipse {
classpath {
downloadSources = true
downloadJavadoc = false
file {
whenMerged { classpath ->
def list = classpath.getEntries()
list.removeAll { it.kind=='lib' && it.path.contains('javax.validation') && it.path.contains('validation-api') }
classpath.setEntries(list)
}
}
}
jdt {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
project.file.whenMerged { project ->
project.natures.remove('org.springsource.ide.eclipse.gradle.core.nature')
project.natures.remove('org.eclipse.buildship.core.gradleprojectnature')
}
}
javadoc {
failOnError = false
}
afterEvaluate {
if(plugins.hasPlugin(JavaPlugin)) {
// configuration here
rootProject.tasks.generateJavadoc {
source += files(sourceSets.collect { srcSet -> srcSet.allJava })
classpath += files(sourceSets*.compileClasspath)
}
}
}
install.enabled = !project.properties.containsKey('pro')
uploadArchives.enabled = !project.properties.containsKey('pro')
task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts { archives sourcesJar }
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: deployUploadUrl) {
authentication(userName: deployUser, password: deployPassword)
}
}
}
task deploy {
description 'Shortcut for Maven users'
dependsOn tasks.uploadArchives
}
task testJar(type: Jar) {
classifier "test"
from sourceSets.test.output
}
test {
ignoreFailures true
systemProperty "test.server", System.getProperty("test.server", "h2")
systemProperty "test.client", System.getProperty("test.client", "h2")
systemProperty "test.root", System.getProperty("test.root", "h2")
systemProperty "port.number", System.getProperty("port.number", "31415")
systemProperty "db2i.db.user", System.getProperty("db2i.db.user")
systemProperty "db2i.db.password", System.getProperty("db2i.db.password")
minHeapSize = "128m"
maxHeapSize = "512m"
forkEvery=1
}
jar {
manifest {
attributes("Implementation-Title": project.name,
"Implementation-Version": version,
"Project-Artifact": project.name,
"Build-Version": version,
"Build-Time": new SimpleDateFormat("yyyyMMdd-HHmm").format(new Date()),
"Build-Scm-Version": scmVersion)
}
}
artifacts { testArtifacts testJar }
ext {
bshVersion = '2.0b6'
commonsBeanUtilsVersion = '1.9.3'
commonsCliVersion = '1.4'
commonsDbcpVersion = '1.4'
commonsFileuploadVersion = '1.4'
commonsIoVersion = '2.6'
commonsLangVersion = '2.6'
commonsNetVersion = '3.6'
commonsCodecVersion = '1.12'
commonsCollectionVersion = '3.2.2'
hamcrestVersion = '1.3'
h2Version = '1.3.176'
derbyVersion = '10.14.2.0'
mariaDbVersion = '2.4.0'
postgresqlVersion = '42.2.5'
hsqldbVersion = '2.4.1'
sqliteVersion = '3.25.2'
firebirdVersion = '3.0.5'
jt400Version = '9.7'
javaMailVersion = '1.6.2'
jdomVersion = '2.0.5'
junitVersion = '4.11'
log4jVersion = '1.2.17'
slf4jVersion = '1.7.26'
mockitoVersion = '2.27.0'
powerMockVersion = '2.0.2'
mysqlVersion = '5.1.45'
servletVersion = '3.1.0'
springVersion = '5.1.7.RELEASE'
jtdsVersion = '1.3.1'
voltDbVersion = '8.4.1'
bouncyCastleVersion = '1.59'
animalSnifferVersion = '1.10'
jnaVersion = '4.2.0'
jettyVersion = project.property('jetty.version')
nuodbVersion = '3.3.1'
tiberoVersion = '6'
env = System.getenv()
}
dependencies {
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:jul-to-slf4j:$slf4jVersion"
compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
compile "log4j:log4j:$log4jVersion"
provided "org.apache.derby:derby:$derbyVersion"
provided "org.apache.derby:derbytools:$derbyVersion"
provided "mysql:mysql-connector-java:$mysqlVersion"
provided ("org.mariadb.jdbc:mariadb-java-client:$mariaDbVersion") { exclude group: 'net.java.dev.jna' }
provided "org.postgresql:postgresql:$postgresqlVersion"
provided "jdbc:ojdbc8:18.3.0.0"
provided "net.sourceforge.jtds:jtds:$jtdsVersion"
provided "org.voltdb:voltdbclient:$voltDbVersion"
provided "org.hsqldb:hsqldb:$hsqldbVersion"
provided "com.h2database:h2:$h2Version"
provided "org.xerial:sqlite-jdbc:$sqliteVersion"
provided ("org.firebirdsql.jdbc:jaybird:$firebirdVersion") {
exclude group: 'geronimo-spec'
exclude group: 'log4j'
exclude group: 'junit'
exclude group: 'xalan'
}
provided "xalan:xalan:2.7.1" // Required by org.firebirdsql.jdbc:jaybird, but a user's security requirement was for a newer version of xalan.
provided ("net.sf.jt400:jt400:$jt400Version")
provided "jdbc.nuodb:nuodb-jdbc:$nuodbVersion"
provided "jdbc.tibero:tibero:$tiberoVersion"
// javax.resource needed by jaybird
provided "org.apache.geronimo.specs:geronimo-j2ee-connector_1.6_spec:1.0"
provided ("com.datastax.cassandra:cassandra-driver-core:3.1.4") {
exclude group: 'org.slf4j'
}
provided ("nl.cad:tps-parse:1.0.15-SNAPSHOT") {
exclude group: 'commons-lang', module: 'commons-lang'
}
provided ("org.apache.kafka:kafka-clients:1.1.0") {
exclude group: 'org.slf4j'
}
provided ("org.apache.avro:avro:1.8.2") {
exclude group: 'org.slf4j'
}
provided ("io.confluent:kafka-avro-serializer:3.2.1") {
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'org.slf4j'
}
testCompile fileTree(dir: System.getProperty("user.home") + '/.symmetricds/lib', include: '*.jar')
testCompile "junit:junit:$junitVersion"
testCompile "org.hamcrest:hamcrest-all:$hamcrestVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.powermock:powermock-api-mockito2:$powerMockVersion"
testCompile "org.powermock:powermock-module-junit4:$powerMockVersion"
deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
}
task develop {
dependsOn tasks.cleanEclipse, tasks.eclipse
doLast {
def wstFacetXml = "$projectDir/.settings/org.eclipse.wst.common.project.facet.core.xml"
println "Deleting $wstFacetXml"
delete wstFacetXml
}
}
}