forked from pravega/flink-connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
186 lines (165 loc) · 6.38 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
/**
* 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()
}
dependencies {
classpath group: 'com.github.jengelman.gradle.plugins', name:'shadow', version: shadowGradlePlugin
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${bintrayPluginVersion}"
classpath "org.ajoberstar:gradle-git:${gradleGitPluginVersion}"
}
}
apply plugin: 'eclipse'
apply from: 'gradle/idea.gradle'
apply from: 'gradle/java.gradle'
apply from: 'gradle/checkstyle.gradle'
apply from: 'gradle/findbugs.gradle'
apply from: 'gradle/jacoco.gradle'
apply from: 'gradle/maven.gradle'
apply from: 'gradle/bintray.gradle'
apply plugin: 'org.ajoberstar.grgit'
group = "io.pravega"
version = getProjectVersion()
repositories {
mavenLocal()
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 {
}
all {
resolutionStrategy {
// pravega/pravega/issues/2464
force 'io.netty:netty-tcnative-boringssl-static:2.0.8.Final'
}
}
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.google.code.findbugs', name: 'annotations', version: findbugsVersion
compile(group: 'io.pravega', name: 'pravega-client', version: pravegaVersion) {
exclude group: 'org.slf4j', module: 'slf4j-api'
// lombok and findbugs should be compileOnly
exclude group: 'org.projectlombok', module: 'lombok'
exclude group: 'com.google.code.findbugs', module: 'annotations'
exclude group: 'com.google.code.findbugs', module: 'jsr305'
// pravega-shared pulls in curator which isn't needed on the client
exclude group: 'org.apache.curator', module: 'curator-recipes'
}
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
compileOnly group: 'org.apache.flink', name: 'flink-streaming-scala_2.11', version: flinkVersion // provided by application
compileOnly group: 'org.apache.flink', name: 'flink-table_2.11', version: flinkVersion // provided by application
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion // provided by flink-runtime
testCompile group: 'junit', name: 'junit', version: junitVersion
testCompile group: 'org.mockito', name: 'mockito-all', version: mockitoVersion
testCompile group: 'org.apache.flink', name: 'flink-tests_2.11', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-test-utils_2.11', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-streaming-java_2.11', classifier: 'tests', version: flinkVersion
testCompile group: 'org.apache.flink', name: 'flink-runtime_2.11', classifier: 'tests', version: flinkVersion
testCompile group: 'io.pravega', name: 'pravega-standalone', version: pravegaVersion
// configuring the shaded pom dependencies
shadowOnly group: 'org.slf4j', name: 'slf4j-api', version: slf4jApiVersion
shadowOnly group: 'org.apache.flink', name: 'flink-streaming-java_2.11', version: flinkVersion
shadowOnly group: 'org.apache.flink', name: 'flink-table_2.11', 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")
}