forked from linkedin/ambry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
359 lines (325 loc) · 13 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
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
// Copyright (C) 2014-2016 LinkedIn Corp. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied.
buildscript {
repositories {
mavenCentral()
}
apply from: file('gradle/buildscript.gradle'), to: buildscript
}
apply from: file('gradle/license.gradle')
apply from: file('gradle/environment.gradle')
apply from: file("gradle/dependency-versions.gradle")
allprojects {
group = "com.github.ambry"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
apply plugin: 'jacoco'
repositories {
mavenCentral()
mavenLocal()
}
}
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
test {
java.srcDir file('src/integration-test/java')
resources.srcDir file('src/integration-test/resources')
}
unitTest {
java.srcDir file('src/test/java')
resources.srcDir file('src/test/resources')
}
}
dependencies {
compile "log4j:log4j:$log4jVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "org.slf4j:slf4j-log4j12:$slf4jVersion"
testCompile "junit:junit:$junitVersion"
testCompile "org.mockito:mockito-core:2.+"
unitTestCompile sourceSets.main.output
unitTestCompile sourceSets.test.output
unitTestCompile configurations.testCompile
unitTestRuntime configurations.testRuntime
testRuntime project(':log4j-test-config')
}
test {
testLogging {
exceptionFormat = 'full'
}
}
task unitTest(type: Test) {
testLogging {
exceptionFormat = 'full'
}
testClassesDir = sourceSets.unitTest.output.classesDir
classpath += sourceSets.unitTest.runtimeClasspath
}
// only run unit tests when doing a standard build,
// but run integration tests too when running the test target
check.dependsOn -= test
check.dependsOn += unitTest
task testJar(type: Jar) {
from sourceSets.test.output
classifier = 'test'
}
artifacts {
archives testJar
}
}
project(':ambry-utils') {
dependencies {
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "commons-codec:commons-codec:$commonsVersion"
compile "org.json:json:$jsonVersion"
compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion"
testCompile "org.apache.helix:helix-core:$helixVersion"
}
}
project(':ambry-api') {
dependencies {
compile project(':ambry-utils')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "org.codehaus.jackson:jackson-core-asl:$jacksonVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
testCompile project(':ambry-utils').sourceSets.test.output
}
}
project(':ambry-account') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils'),
project(':ambry-commons')
compile "org.apache.helix:helix-core:$helixVersion"
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "org.json:json:$jsonVersion"
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
}
}
project(':ambry-clustermap') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils')
compile "org.apache.helix:helix-core:$helixVersion"
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "org.json:json:$jsonVersion"
testCompile project(':ambry-commons')
testCompile project(':ambry-utils').sourceSets.test.output
}
}
project(':ambry-commons') {
dependencies {
compile project(':ambry-api'),
project(':ambry-clustermap'),
project(':ambry-messageformat'),
project(':ambry-utils')
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
}
}
project(':ambry-network') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils'),
project(':ambry-commons')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
}
}
project(':ambry-server') {
dependencies {
compile project(':ambry-clustermap'),
project(':ambry-messageformat'),
project(':ambry-network'),
project(':ambry-protocol'),
project(':ambry-commons'),
project(':ambry-store'),
project(':ambry-utils'),
project(':ambry-replication')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-router')
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-network').sourceSets.test.output
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-replication').sourceSets.test.output
testCompile project(':ambry-messageformat').sourceSets.test.output
testCompile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
}
}
project(':ambry-store') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-clustermap')
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-api').sourceSets.test.output
}
}
project(':ambry-messageformat') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
}
}
project(':ambry-replication') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils'),
project(':ambry-store'),
project(':ambry-commons'),
project(':ambry-protocol'),
project(':ambry-network')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-messageformat').sourceSets.test.output
}
}
project(':ambry-tools') {
dependencies {
compile project(':ambry-api'),
project(':ambry-account'),
project(':ambry-store'),
project(':ambry-server'),
project(':ambry-rest'),
project(':ambry-frontend')
compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion"
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-account').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-store').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-messageformat').sourceSets.test.output
}
}
project(':ambry-protocol') {
dependencies {
compile project(':ambry-api'),
project(':ambry-clustermap'),
project(':ambry-messageformat'),
project(':ambry-utils'),
project(':ambry-commons')
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-messageformat').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
}
}
project(':ambry-rest') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils'),
project(':ambry-commons')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "net.sf.jopt-simple:jopt-simple:$joptSimpleVersion"
compile "io.netty:netty-all:$nettyVersion"
compile "io.netty:netty-tcnative-boringssl-static:$nettyTcnativeVersion"
compile "javax.servlet:javax.servlet-api:$javaxVersion"
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-router').sourceSets.main.output
testCompile project(':ambry-router').sourceSets.test.output
testCompile project(':ambry-account').sourceSets.main.output
testCompile project(':ambry-account').sourceSets.test.output
testCompile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
}
}
project(':ambry-router') {
dependencies {
compile project(':ambry-api'),
project(':ambry-utils'),
project(':ambry-commons'),
project(':ambry-clustermap'),
project(':ambry-messageformat'),
project(':ambry-protocol'),
project(':ambry-network')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
compile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-network').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-account').sourceSets.main.output
testCompile project(':ambry-account').sourceSets.test.output
}
}
project(':ambry-frontend') {
dependencies {
compile project(':ambry-api'),
project(':ambry-account'),
project(':ambry-utils'),
project(':ambry-commons'),
project(':ambry-rest'),
project(':ambry-router')
compile "com.codahale.metrics:metrics-core:$metricsVersion"
testCompile project(':ambry-api').sourceSets.test.output
testCompile project(':ambry-account').sourceSets.test.output
testCompile project(':ambry-clustermap').sourceSets.test.output
testCompile project(':ambry-rest').sourceSets.test.output
testCompile project(':ambry-utils').sourceSets.test.output
testCompile project(':ambry-commons').sourceSets.test.output
testCompile project(':ambry-router').sourceSets.test.output
testCompile "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion"
}
}
subprojects.each { subproject -> evaluationDependsOn(subproject.path)}
task allJar(type: Jar, dependsOn: subprojects.assemble) {
manifest {
attributes 'Implementation-Title': 'Ambry',
'Main-Class': 'com.github.ambry.server.AmbryMain'
}
zip64 true
destinationDir = file('target')
baseName = 'ambry'
subprojects.each { subproject ->
from {
(subproject.configurations.archives.allArtifacts.files + subproject.configurations.runtime).collect {
zipTree(it)
}
}
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination "${buildDir}/reports/jacoco/report.xml"
html.enabled true
csv.enabled true
}
}
codeCoverageReport.dependsOn {
subprojects*.unitTest
}