Skip to content

Commit

Permalink
enhancement: Shade gRPC dependencies (#108)
Browse files Browse the repository at this point in the history
Lots of projects are still stuck on older versions of protobuf and have
dependency conflicts with the protobuf dependencies required by
cerbos-sdk-java. Publishing a shaded jar should help those users.

Signed-off-by: Charith Ellawala <[email protected]>
  • Loading branch information
charithe committed Sep 5, 2024
1 parent 26872f6 commit 85946f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
id("com.google.protobuf") version "0.9.4"
id("com.palantir.git-version") version "3.1.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("com.gradleup.shadow") version "8.3.0"
}

val gitVersion: groovy.lang.Closure<String> by extra
Expand Down Expand Up @@ -84,6 +85,15 @@ tasks.getByName<Test>("test") {
useJUnitPlatform()
}

tasks.shadowJar {
relocate("com.google.protobuf", "dev.cerbos.shaded.com.google.protobuf")
relocate("io.grpc", "dev.cerbos.shaded.io.grpc")
minimize()
}

tasks.build {
dependsOn(tasks.shadowJar)
}

publishing {
repositories {
Expand Down

0 comments on commit 85946f5

Please sign in to comment.