-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle
771 lines (701 loc) · 33.2 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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
import com.github.spotbugs.snom.SpotBugsTask
import org.gradle.internal.jvm.Jvm
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
/**
* Copyright (c) Dell Inc., or its subsidiaries. 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
*
*/
apply plugin: 'org.ajoberstar.grgit'
// Apply the java plugin to add support for Java
buildscript {
// log the current JVM version.
println "Build JVM Version is : " + Jvm.current()
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.github.jengelman.gradle.plugins', name:'shadow', version: shadowGradlePlugin
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.0"
classpath group: 'org.hidetake', name: 'gradle-ssh-plugin', version: gradleSshPluginVersion
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:${spotbugsPluginVersion}"
classpath "org.ajoberstar.grgit:grgit-gradle:${gradleGitPluginVersion}"
classpath "org.ajoberstar.grgit:grgit-core:${gradleGitPluginVersion}"
classpath "io.franzbecker:gradle-lombok:${gradleLombokPluginVersion}"
}
}
allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
if (file("src/main/java").isDirectory()) {
apply plugin: 'java'
apply plugin: 'io.franzbecker.gradle-lombok'
lombok {
version = lombokVersion
}
dependencies {
//These are compile time only dependencies needed accross all targets. Lombok uses them and may generate strange errors if they are missing.
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
testCompile group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
compileOnly 'org.projectlombok:lombok:' + lombokVersion
testCompileOnly 'org.projectlombok:lombok:' + lombokVersion
annotationProcessor 'org.projectlombok:lombok:' + lombokVersion
testAnnotationProcessor 'org.projectlombok:lombok:' + lombokVersion
}
// Delombok sources.
task delombok(type: io.franzbecker.gradle.lombok.task.DelombokTask, dependsOn: compileJava) {
ext.outputDir = file("$buildDir/delombok")
outputs.dir(outputDir)
sourceSets.main.java.srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
}
}
// Plugin configurations
apply from: "$rootDir/gradle/application.gradle"
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/eclipse.gradle"
apply from: "$rootDir/gradle/spotbugs.gradle"
apply from: "$rootDir/gradle/idea.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/maven.gradle"
apply from: "$rootDir/gradle/protobuf.gradle"
apply from: "$rootDir/gradle/rat.gradle"
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://repository.apache.org/snapshots"
}
maven {
url "https://maven.pkg.github.com/pravega/pravega"
credentials {
username = "pravega-public"
password = "\u0067\u0068\u0070\u005F\u0048\u0034\u0046\u0079\u0047\u005A\u0031\u006B\u0056\u0030\u0051\u0070\u006B\u0079\u0058\u006D\u0035\u0063\u0034\u0055\u0033\u006E\u0032\u0065\u0078\u0039\u0032\u0046\u006E\u0071\u0033\u0053\u0046\u0076\u005A\u0049"
}
}
maven {
url "https://maven.pkg.github.com/pravega/pravega-keycloak"
credentials {
username = "pravega-public"
password = "\u0067\u0068\u0070\u005F\u0048\u0034\u0046\u0079\u0047\u005A\u0031\u006B\u0056\u0030\u0051\u0070\u006B\u0079\u0058\u006D\u0035\u0063\u0034\u0055\u0033\u006E\u0032\u0065\u0078\u0039\u0032\u0046\u006E\u0071\u0033\u0053\u0046\u0076\u005A\u0049"
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
tasks.withType(SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}
version = getProjectVersion()
group = "io.pravega"
configurations.all {
resolutionStrategy {
force "com.google.guava:guava:" + guavaVersion
force "com.google.protobuf:protobuf-java:" + protobufProtocVersion
force "commons-beanutils:commons-beanutils:" + commonsBeanutilsVersion
force "org.apache.commons:commons-compress:" + apacheCommonsCompressVersion
force "org.apache.commons:commons-lang3:" + commonsLang3Version
force "org.glassfish.jersey.core:jersey-common:" + jerseyVersion
force "org.glassfish.jersey.core:jersey-server:" + jerseyVersion
force "org.slf4j:slf4j-api:" + slf4jApiVersion
force "io.netty:netty-tcnative-boringssl-static:" + nettyBoringSSLVersion
force "org.apache.zookeeper:zookeeper:" + apacheZookeeperVersion
force "org.yaml:snakeyaml:" +snakeYamlVersion
}
}
}
subprojects {
task allDeps(type: DependencyReportTask) {}
}
def withoutLogger = { exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.slf4j', module: 'slf4j-simple' }
project('common') {
dependencies {
compile group: 'commons-io', name: 'commons-io', version: commonsioVersion, withoutLogger
compile group: 'com.google.guava', name: 'guava', version: guavaVersion, withoutLogger
compile group: 'javax.activation', name: 'activation', version: javaxActivationVersion
compileOnly group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
//Do NOT add any additional dependencies to common. All other sub projects depend on common and any project specific
//dependency should be added to the specific project.
}
javadoc {
title = "Common Libraries"
dependsOn delombok
source = delombok.outputDir
failOnError = true
options.addBooleanOption("Xdoclint:none", true)
}
}
project('auth') {
dependencies {
compile project(':common')
compileOnly group: 'io.pravega', name: 'pravega-shared-authplugin', version: pravegaVersion
}
javadoc {
title = "Auth Libraries"
dependsOn delombok
source = delombok.outputDir
failOnError = true
options.addBooleanOption("Xdoclint:none", true)
}
}
project('client') {
dependencies {
compile project(':common')
compile project(':auth')
compile project(':contract')
compile group: 'org.glassfish.jersey.ext', name: 'jersey-proxy-client', version: jerseyVersion, withoutLogger
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: jerseyVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
compileOnly group: 'io.pravega', name: 'pravega-shared-authplugin', version: pravegaVersion
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-shared-authplugin', version: pravegaVersion
}
javadoc {
title = "Registry Client"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('contract') {
dependencies {
compile project(':common')
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
compile group: 'javax.servlet', name: 'javax.servlet-api', version: javaxServletApiVersion, withoutLogger
compile(group: 'io.swagger', name : 'swagger-jersey2-jaxrs', version :swaggerJersey2JaxrsVersion) {
exclude group: 'com.google.guava', module: 'guava'
}
compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-http', version: jerseyVersion, withoutLogger
compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: jerseyVersion, withoutLogger
compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: jerseyVersion, withoutLogger
compile group: 'javax.xml.bind', name: 'jaxb-api', version: jaxbVersion, withoutLogger
compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: jaxbVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
}
javadoc {
title = "Registry Contract"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
def getProjectVersion() {
String ver = schemaregistryVersion
if (grgit && ver.contains("-SNAPSHOT")) {
String versionLabel = ver.substring(0, ver.indexOf("-SNAPSHOT"))
def count = grgit.log(includes:['HEAD']).size()
def commitId = "${grgit.head().abbreviatedId}"
ver = versionLabel + "-" + count + "." + commitId + "-SNAPSHOT"
}
return ver
}
project('serializers:shared') {
dependencies {
compile project(':common')
compile project(':client')
compileOnly group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
compileOnly group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
compile group: 'org.xerial.snappy', name: 'snappy-java', version: snappyVersion, withoutLogger
testCompile group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
}
javadoc {
title = "Serializers shared"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('serializers:avro') {
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':serializers:shared')
compile group: 'org.apache.avro', name: 'avro', version: avroVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
testCompile project(path:':serializers:shared', configuration:'testRuntime')
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
}
shadowJar {
// Add zip64=true so that we are able to pack more than 65k files in the jar.
zip64 true
relocate 'org.xerial.snappy' , 'io.pravega.schemaregistry.shaded.org.xerial.snappy'
relocate 'org.glassfish.jersey.ext' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.ext'
relocate 'org.glassfish.jersey.core' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.core'
relocate 'javax.servlet' , 'io.pravega.schemaregistry.shaded.javax.servlet'
relocate 'io.swagger' , 'io.pravega.schemaregistry.shaded.io.swagger'
relocate 'org.glassfish.jersey.containers' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.containers'
relocate 'org.glassfish.jersey.inject' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.inject'
relocate 'org.glassfish.jersey.media' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.media'
relocate 'org.glassfish.jaxb' , 'io.pravega.schemaregistry.shaded.org.glassfish.jaxb'
relocate 'javax.xml.bind' , 'io.pravega.schemaregistry.shaded.javax.xml.bind'
relocate 'com.google.guava' , 'io.pravega.schemaregistry.shaded.com.google.guava'
relocate 'commons-io' , 'io.pravega.schemaregistry.shaded.commons-io'
classifier ='all'
mergeServiceFiles()
}
tasks.build.dependsOn tasks.shadowJar
artifacts { archives shadowJar }
javadoc {
title = "Serializers avro"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('serializers:protobuf') {
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':serializers:shared')
compile group: 'com.google.protobuf', name: 'protobuf-java', version: protobufProtocVersion, withoutLogger
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufUtilVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
testCompile project(path:':serializers:shared', configuration:'testRuntime')
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
}
shadowJar {
zip64 true
relocate 'org.xerial.snappy' , 'io.pravega.schemaregistry.shaded.org.xerial.snappy'
relocate 'org.glassfish.jersey.ext' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.ext'
relocate 'org.glassfish.jersey.core' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.core'
relocate 'javax.servlet' , 'io.pravega.schemaregistry.shaded.javax.servlet'
relocate 'io.swagger' , 'io.pravega.schemaregistry.shaded.io.swagger'
relocate 'org.glassfish.jersey.containers' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.containers'
relocate 'org.glassfish.jersey.inject' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.inject'
relocate 'org.glassfish.jersey.media' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.media'
relocate 'org.glassfish.jaxb' , 'io.pravega.schemaregistry.shaded.org.glassfish.jaxb'
relocate 'javax.xml.bind' , 'io.pravega.schemaregistry.shaded.javax.xml.bind'
relocate 'com.google.guava' , 'io.pravega.schemaregistry.shaded.com.google.guava'
relocate 'commons-io' , 'io.pravega.schemaregistry.shaded.commons-io'
classifier ='all'
mergeServiceFiles()
}
tasks.build.dependsOn tasks.shadowJar
artifacts { archives shadowJar }
javadoc {
title = "Serializers protobuf"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('serializers:json') {
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':serializers:shared')
compile group: 'com.github.erosb', name: 'everit-json-schema', version: everitVersion, withoutLogger
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-jsonSchema', version: jacksonVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
testCompile project(path:':serializers:shared', configuration:'testRuntime')
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
}
shadowJar {
zip64 true
relocate 'org.xerial.snappy' , 'io.pravega.schemaregistry.shaded.org.xerial.snappy'
relocate 'org.glassfish.jersey.ext' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.ext'
relocate 'org.glassfish.jersey.core' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.core'
relocate 'javax.servlet' , 'io.pravega.schemaregistry.shaded.javax.servlet'
relocate 'io.swagger' , 'io.pravega.schemaregistry.shaded.io.swagger'
relocate 'org.glassfish.jersey.containers' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.containers'
relocate 'org.glassfish.jersey.inject' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.inject'
relocate 'org.glassfish.jersey.media' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.media'
relocate 'org.glassfish.jaxb' , 'io.pravega.schemaregistry.shaded.org.glassfish.jaxb'
relocate 'javax.xml.bind' , 'io.pravega.schemaregistry.shaded.javax.xml.bind'
relocate 'com.google.guava' , 'io.pravega.schemaregistry.shaded.com.google.guava'
relocate 'commons-io' , 'io.pravega.schemaregistry.shaded.commons-io'
classifier ='all'
mergeServiceFiles()
}
artifacts { archives shadowJar }
tasks.build.dependsOn tasks.shadowJar
javadoc {
title = "Serializers json"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('serializers') {
apply plugin: 'com.github.johnrengelman.shadow'
dependencies {
compile project(':serializers:avro')
compile project(':serializers:protobuf')
compile project(':serializers:json')
compile group: 'org.xerial.snappy', name: 'snappy-java', version: snappyVersion, withoutLogger
compileOnly group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
compileOnly group: 'io.pravega', name: 'pravega-common', version: pravegaVersion
testCompile project(path:':serializers:shared', configuration:'testRuntime')
testCompile files(project(':serializers:avro').sourceSets.test.output)
testCompile files(project(':serializers:protobuf').sourceSets.test.output)
testCompile files(project(':serializers:json').sourceSets.test.output)
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
}
shadowJar {
zip64 true
relocate 'org.xerial.snappy' , 'io.pravega.schemaregistry.shaded.org.xerial.snappy'
relocate 'org.glassfish.jersey.ext' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.ext'
relocate 'org.glassfish.jersey.core' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.core'
relocate 'javax.servlet' , 'io.pravega.schemaregistry.shaded.javax.servlet'
relocate 'io.swagger' , 'io.pravega.schemaregistry.shaded.io.swagger'
relocate 'org.glassfish.jersey.containers' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.containers'
relocate 'org.glassfish.jersey.inject' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.inject'
relocate 'org.glassfish.jersey.media' , 'io.pravega.schemaregistry.shaded.org.glassfish.jersey.media'
relocate 'org.glassfish.jaxb' , 'io.pravega.schemaregistry.shaded.org.glassfish.jaxb'
relocate 'javax.xml.bind' , 'io.pravega.schemaregistry.shaded.javax.xml.bind'
relocate 'com.google.guava' , 'io.pravega.schemaregistry.shaded.com.google.guava'
relocate 'commons-io' , 'io.pravega.schemaregistry.shaded.commons-io'
classifier ='all'
mergeServiceFiles()
}
tasks.build.dependsOn tasks.shadowJar
artifacts { archives shadowJar }
javadoc {
title = "Serializers"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('server') {
sourceSets {
main.resources.srcDirs += "$projectDir/src/conf"
test.resources.srcDirs += "$rootDir/resources"
}
apply plugin: 'application'
applicationName = "schema-registry"
mainClassName = "io.pravega.schemaregistry.service.Main"
applicationDefaultJvmArgs = ["-server", "-Xms128m", "-XX:+HeapDumpOnOutOfMemoryError",
"-Dconfig.file=PRAVEGA_APP_HOME/conf/schema-registry.config.properties",
"-Dlogback.configurationFile=PRAVEGA_APP_HOME/conf/logback.xml",
"-Dlog.dir=PRAVEGA_APP_HOME/logs",
"-Dlog.name=schemaregistry"]
startScripts {
classpath += files('$APP_HOME/pluginlib')
doLast {
def scriptFile = file getUnixScript()
scriptFile.text = scriptFile.text.replace('$APP_HOME/lib/pluginlib', '$APP_HOME/pluginlib/*')
def winScriptFile = file getWindowsScript()
winScriptFile.text = winScriptFile.text.replace('%APP_HOME%\\lib\\pluginlib', '%APP_HOME%\\pluginlib\\*')
}
}
applicationDistribution.from('src/conf') {
into "conf"
rename "application.conf", "schemaregistry.conf"
}
applicationDistribution.into('') {
def pluginDirBase = new File('/tmp/dummy-dir')
pluginDirBase.mkdirs()
def logDir = new File(pluginDirBase.absolutePath + '/pluginlib')
logDir.mkdirs()
from {pluginDirBase}
}
dependencies {
compile project(':common')
compile project(':auth')
compile project(':contract')
compile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion, withoutLogger
compile group: 'io.pravega', name: 'pravega-shared-basic-authplugin', version: pravegaVersion, withoutLogger
compile group: 'org.apache.avro', name: 'avro', version: avroVersion, withoutLogger
compile group: 'org.apache.avro', name: 'avro-protobuf', version: avroProtobufVersion, withoutLogger
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: protobufUtilVersion, withoutLogger
compile group: 'com.google.protobuf', name: 'protobuf-java', version: protobufProtocVersion, withoutLogger
compile group: 'com.fasterxml.jackson.module', name: 'jackson-module-jsonSchema', version: jacksonVersion, withoutLogger
compile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
compile group: 'com.github.erosb', name: 'everit-json-schema', version: everitVersion, withoutLogger
runtime group: 'io.pravega', name: 'pravega-keycloak-client', version: pravegaKeyCloakVersion
runtime group: 'io.netty', name: 'netty-tcnative-boringssl-static', version: nettyBoringSSLVersion
compile group: 'io.pravega', name: 'pravega-common', version: pravegaVersion, withoutLogger
compile group: 'io.pravega', name: 'pravega-shared-authplugin', version: pravegaVersion, withoutLogger
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
compile group: 'org.slf4j', name: 'slf4j-simple', version: slf4jApiVersion
testCompile (group: 'io.pravega', name: 'pravega-standalone', version: pravegaVersion) {
exclude group: 'javax.ws.rs', module: 'jsr311-api'
}
testCompile group: 'io.pravega', name: 'pravega-shared-basic-authplugin', version: pravegaVersion
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'org.glassfish.jersey.test-framework.providers', name: 'jersey-test-framework-provider-grizzly2', version: jerseyVersion
}
javadoc {
title = "Registry Server"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
project('test') {
sourceSets {
test.resources.srcDirs += "$rootDir/resources"
test.java.srcDir project(':server').file("src/test/java")
test.java.srcDir project(':serializers').file("src/test/java")
test.java.srcDir project(':serializers:shared').file("src/test/java")
test.java.srcDir project(':serializers:protobuf').file("src/test/java")
test.java.srcDir project(':serializers:json').file("src/test/java")
test.java.srcDir project(':serializers:avro').file("src/test/java")
}
compileTestJava.dependsOn tasks.getByPath(':server:testClasses')
dependencies {
compile project(':common')
compile project(':contract')
compile project(':client')
compile project(':server')
compile project(':serializers')
compile project(':serializers:protobuf')
compile project(':serializers:avro')
compile project(':serializers:json')
compile project(':serializers:shared')
compile group: 'io.pravega', name: 'pravega-client', version: pravegaVersion
testCompile (group: 'io.pravega', name: 'pravega-standalone', version: pravegaVersion) {
exclude group: 'javax.ws.rs', module: 'jsr311-api'
}
testCompile group: 'io.pravega', name: 'pravega-test-testcommon', version: pravegaVersion
testCompile group: 'org.slf4j', name: 'log4j-over-slf4j', version: slf4jApiVersion
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: qosLogbackVersion
testCompile files(project(':server').sourceSets.test.output.classesDirs)
testCompile group: 'org.glassfish.jersey.test-framework.providers', name: 'jersey-test-framework-provider-grizzly2', version: jerseyVersion
}
javadoc {
title = "Test"
dependsOn delombok
source = delombok.outputDir
failOnError = true
exclude "**/impl/**";
options.addBooleanOption("Xdoclint:all,-reference", true)
}
}
apply plugin: 'distribution'
distributions {
main {
baseName = "schema-registry"
contents {
duplicatesStrategy = "exclude"
from ("dist/conf") {
into "conf"
}
from ("config") {
into "conf"
}
from (project(":server").installDist) {
exclude "logback.xml"
}
from 'LICENSE'
from 'NOTICE'
}
}
client {
baseName = "schema-registry-client"
contents {
from { project(":client").configurations.runtime }
from { project(":client").configurations.runtime.allArtifacts.files }
from 'LICENSE'
from 'NOTICE'
}
}
serializers {
baseName = "schema-registry-serializers"
contents {
from { project(":serializers").configurations.runtime }
from { project(":serializers").configurations.runtime.allArtifacts.files }
from 'LICENSE'
from 'NOTICE'
}
}
avroserializer {
baseName = "schema-registry-avro-serializer"
contents {
from { project(":serializers:avro").configurations.runtime }
from { project(":serializers:avro").configurations.runtime.allArtifacts.files }
from 'LICENSE'
from 'NOTICE'
}
}
protobufserializer {
baseName = "schema-registry-protobuf-serializer"
contents {
from { project(":serializers:protobuf").configurations.runtime }
from { project(":serializers:protobuf").configurations.runtime.allArtifacts.files }
from 'LICENSE'
from 'NOTICE'
}
}
jsonserializer {
baseName = "schema-registry-json-serializer"
contents {
from { project(":serializers:json").configurations.runtime }
from { project(":serializers:json").configurations.runtime.allArtifacts.files }
from 'LICENSE'
from 'NOTICE'
}
}
}
tasks.withType(Tar) {
compression = Compression.GZIP
}
task sourceCopy(type: Copy) {
from rootDir
into 'source'
}
task sourceTar(type: Tar) {
dependsOn 'sourceCopy'
from 'source'
destinationDir = file('sourceArtifacts')
extension = 'tgz'
compression = Compression.GZIP
}
task javadocs(type: Javadoc) {
description = "Generate main pravega javadoc"
// Include names of any project that is to be included in the javadoc distribution
ext.projects = [':client', ':serializers', ':serializers:json', ':serializers:avro', ':serializers:protobuf']
options.links("http://docs.oracle.com/javase/10/docs/api/");
title = "Schema Registry API"
destinationDir = file("${buildDir}/javadocs")
source = files(projects.collect {
project(it).sourceSets.main.allJava
})
classpath = files(projects.collect {
project(it).sourceSets.main.output + project(it).sourceSets.main.compileClasspath
})
failOnError = true
exclude "**/impl/**"
options.addBooleanOption("Xdoclint:all,-reference", true)
}
task publishAllJars() {
dependsOn ':client:publish'
dependsOn ':common:publish'
dependsOn ':contract:publish'
dependsOn ':server:publish'
dependsOn ':serializers:shared:publish'
dependsOn ':serializers:avro:publish'
dependsOn ':serializers:json:publish'
dependsOn ':serializers:protobuf:publish'
dependsOn ':serializers:publish'
}
task prepareRegistryImage(type: Copy) {
into "${buildDir}/docker/pravega-schema-registry"
from "docker/pravega-schema-registry"
from (installDist) {
into "pravega-schema-registry"
exclude "**/*.bat"
}
}
task buildRegistryImage(type: DockerBuildTask, dependsOn: prepareRegistryImage) {
baseTag = schemaregistryBaseTag
dockerDir = prepareRegistryImage.destinationDir.absolutePath
dockerFile = "${dockerDir}/Dockerfile"
}
task docker(dependsOn: buildRegistryImage) {
description = "Builds all docker images"
}
task pushRegistryImage(type: DockerPushTask) {
// No explicit dependency on building the pravega image
mustRunAfter buildRegistryImage
tag = "${schemaregistryBaseTag}:${version}"
}
task dockerPush(dependsOn: pushRegistryImage) {
description = "Push all docker images"
}
task distribution(dependsOn: [assembleDist, assembleClientDist, assembleSerializersDist, assembleAvroserializerDist, assembleProtobufserializerDist, assembleJsonserializerDist]) {
description = "Builds a distribution package"
}
/**
* Task for building a docker image
*/
class DockerBuildTask extends Exec {
String baseTag
String dockerDir
String dockerFile
DockerBuildTask() {
executable project.dockerExecutable
args "build"
args "--pull"
args "-t", "${->baseTag}:${project.version}"
args "-t", "${->baseTag}:latest"
args "-f", "${->dockerFile}"
args "${->dockerDir}"
}
}
/**
* Task for pushing an image, which can either push to dockerhub or to a private registry.
* If pushing to dockerhub, you must be logged using using `docker login` before running.
*/
class DockerPushTask extends Exec {
String tag
DockerPushTask() {
executable project.dockerExecutable
args "push", "${->getRemoteTag()}"
}
protected void exec() {
// Tag the image with the remote image name first
if (project.hasProperty('dockerRegistry')) {
project.exec {
commandLine project.dockerExecutable, "tag", tag, getRemoteTag()
}
}
super.exec()
}
String getRemoteTag() {
if (project.hasProperty('dockerRegistry')) {
return "${project.property('dockerRegistry')}/${tag}"
}
else {
return tag
}
}
}