forked from pravega/flink-connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
226 lines (202 loc) · 8.94 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
/**
* Copyright (c) 2017 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
*
*/
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath group: 'com.github.jengelman.gradle.plugins', name:'shadow', version: shadowGradlePlugin
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${bintrayPluginVersion}"
classpath group: 'org.hidetake', name: 'gradle-ssh-plugin', version: gradleSshPluginVersion
classpath "ru.vyarus:gradle-mkdocs-plugin:${gradleMkdocsPluginVersion}"
classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:${spotbugsPluginVersion}"
}
}
plugins {
id "com.github.spotbugs"
}
apply plugin: 'eclipse'
apply from: 'gradle/idea.gradle'
apply from: 'gradle/java.gradle'
apply from: 'gradle/checkstyle.gradle'
apply from: 'gradle/spotbugs.gradle'
apply from: 'gradle/jacoco.gradle'
apply from: 'gradle/maven.gradle'
apply from: 'gradle/bintray.gradle'
apply plugin: 'org.ajoberstar.grgit'
apply from: 'gradle/mkdocs.gradle'
apply from: 'gradle/jacoco.gradle'
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
group = "io.pravega"
version = getProjectVersion()
repositories {
mavenLocal()
mavenCentral()
if (findProperty("repositoryUrl")) {
maven {
url findProperty("repositoryUrl")
}
}
else {
jcenter()
mavenCentral()
maven {
url "https://repository.apache.org/snapshots"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://oss.jfrog.org/jfrog-dependencies"
}
}
}
configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor 60, 'minutes'
cacheChangingModulesFor 60, 'minutes'
}
}
configurations {
shadowOnly {
}
testCompile.extendsFrom(compileOnly)
testCompile.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
testCompile.exclude group: 'log4j', module: 'log4j'
}
test {
testLogging {
onOutput { descriptor, event ->
if (project.hasProperty('logOutput')) {
events = ["passed", "failed", "skipped"]
showStandardStreams = true
logger.lifecycle(event.message)
}
}
}
}
dependencies {
compileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
testCompileOnly group: 'com.github.spotbugs', name: 'spotbugs-annotations', version: spotbugsAnnotationsVersion
compileOnly group: 'net.jcip', name: 'jcip-annotations', version: jcipAnnotationsVersion
testCompileOnly group: 'net.jcip', name: 'jcip-annotations', version: jcipAnnotationsVersion
compile(group: 'io.pravega', name: 'pravega-client', version: pravegaVersion) {
exclude group: 'org.slf4j', module: 'slf4j-api'
// lombok should be compileOnly
exclude group: 'org.projectlombok', module: 'lombok'
// pravega-shared pulls in curator which isn't needed on the client
exclude group: 'org.apache.curator', module: 'curator-recipes'
}
// schema registry dependencies
compileOnly group: 'io.pravega', name: 'schemaregistry-serializers', classifier: 'all', version: schemaRegistryVersion
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: slf4jApiVersion // provided by flink-runtime
compile group: 'org.apache.commons', name: 'commons-lang3', version: apacheCommonsVersion
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion // not needed at runtime
annotationProcessor 'org.projectlombok:lombok:' + lombokVersion
compileOnly group: 'org.apache.flink', name: 'flink-streaming-scala_'+flinkScalaVersion, version: flinkVersion // provided by application
compileOnly group: 'org.apache.flink', name: 'flink-table-planner_'+flinkScalaVersion, version: flinkVersion // provided by application
compileOnly group: 'org.apache.flink', name: 'flink-table-planner-blink_'+flinkScalaVersion, version: flinkVersion // provided by application
compileOnly group: 'org.apache.flink', name: 'flink-table-api-java-bridge_'+flinkScalaVersion, version: flinkVersion // provided by application
compileOnly group: 'org.apache.flink', name: 'flink-json', version: flinkVersion
compileOnly group: 'org.apache.flink', name: 'flink-avro', version: flinkVersion
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion // provided by flink-runtime
testAnnotationProcessor 'org.projectlombok:lombok:' + lombokVersion
testCompile group: 'junit', name: 'junit', version: junitVersion
testCompile group: 'org.mockito', name: 'mockito-core', version: mockitoVersion
testCompile group: 'org.apache.flink', name: 'flink-tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-core', classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-test-utils_'+flinkScalaVersion, version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-core', classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-streaming-java_'+flinkScalaVersion, classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-runtime_'+flinkScalaVersion, classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-table-common', classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-json', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-avro', version: flinkVersion
testCompile group: 'io.pravega', name: 'pravega-standalone', version: pravegaVersion
testCompile (group: 'io.pravega', name: 'schemaregistry-server', version: schemaRegistryVersion) {
transitive = false
}
testCompile group: 'io.pravega', name: 'schemaregistry-serializers', classifier: 'all', version: schemaRegistryVersion
// configuring the shaded pom dependencies
shadowOnly group: 'org.slf4j', name: 'slf4j-api', version: slf4jApiVersion
shadowOnly group: 'org.apache.flink', name: 'flink-streaming-java_'+flinkScalaVersion, version: flinkVersion
shadowOnly group: 'org.apache.flink', name: 'flink-table', version: flinkVersion
shadowOnly group: 'org.apache.flink', name: 'flink-json', version: flinkVersion
shadowOnly group: 'org.apache.flink', name: 'flink-avro', version: flinkVersion
}
shadowJar {
// relocate pravega client's dependencies to minimize conflicts
relocate "org.apache.commons", "io.pravega.shaded.org.apache.commons"
relocate "com.google", "io.pravega.shaded.com.google"
relocate "io.grpc", "io.pravega.shaded.io.grpc"
relocate "com.squareup.okhttp", "io.pravega.shaded.com.squareup.okhttp"
relocate "okio", "io.pravega.shaded.okio"
relocate "io.opencensus", "io.pravega.shaded.io.opencensus"
relocate "io.netty", "io.pravega.shaded.io.netty"
relocate 'META-INF/native/libnetty', 'META-INF/native/libio_pravega_shaded_netty'
relocate 'META-INF/native/netty', 'META-INF/native/io_pravega_shaded_netty'
classifier = null
mergeServiceFiles()
}
javadoc {
title = "Pravega Flink Connector"
failOnError = false
exclude "**/impl/**";
}
def getProjectVersion() {
String ver = connectorVersion
if (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
}
distributions {
release {
contents {
from shadowJar
from(project.configurations.shadow)
from javadocJar
from sourceJar
}
}
workspace {
contents {
from ('.') {
exclude "build"
exclude ".gradle"
exclude ".idea"
exclude "out"
exclude "pravega/*"
}
}
}
}
task distribution(type: Copy, dependsOn: [installReleaseDist, installWorkspaceDist, assembleWorkspaceDist]) {
from ("$buildDir/install/flink-connectors-release")
into ("$buildDir/distributions")
}
//allow system properties to be passed to the test program
// for e.g., to use standalone Pravega for running the system test "./gradlew clean build -Dpravega.uri=tcp://localhost:9090"
test {
systemProperties = System.properties
}