Skip to content

Commit f8f2ad3

Browse files
committed
Provide shaded jar with dgraph4j's dependencies
1 parent fd45936 commit f8f2ad3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
18+
1719
buildscript {
1820
repositories {
1921
maven {
@@ -32,6 +34,7 @@ plugins {
3234
id 'com.github.sherter.google-java-format' version '0.9'
3335
id 'base'
3436
id 'maven-publish'
37+
id 'com.gradleup.shadow' version '8.3.2'
3538
}
3639
// Apply the java plugin to add support for Java
3740
apply plugin: 'java'
@@ -171,6 +174,14 @@ task fatJar(type: Jar) {
171174
with jar
172175
}
173176

177+
tasks.named('shadowJar', ShadowJar) {
178+
enableRelocation true
179+
relocationPrefix "io.dgraph.dgraph4j.shaded"
180+
relocate 'google', 'io.dgraph.dgraph4j.shaded.google'
181+
archiveClassifier.set("shaded")
182+
mergeServiceFiles()
183+
}
184+
174185
task buildJar(type: Jar)
175186

176187
task javadocJar(type: Jar) {
@@ -201,6 +212,7 @@ task integrationTest(type: Test) {
201212

202213
artifacts {
203214
archives jar
215+
archives shadowJar
204216
archives sourceJar
205217
archives javadocJar
206218
}

0 commit comments

Comments
 (0)