This repository was archived by the owner on May 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -253,14 +253,19 @@ def getPackagesInDependencyJar(jarFile) {
253
253
// phase; instead we have to run it after configuration, with the "afterEvaluate" block below.
254
254
def shadeDependencies (jarTask ) {
255
255
def excludePackages = getAllSdkPackages() +
256
- configurations. shadow. collectMany { getPackagesInDependencyJar(it)}
256
+ configurations. shadow. collectMany { getPackagesInDependencyJar(it) }
257
257
def topLevelPackages =
258
258
configurations. internal. collectMany {
259
259
getPackagesInDependencyJar(it). collect { it. contains(" ." ) ? it. substring(0 , it. indexOf(" ." )) : it }
260
260
}.
261
261
unique()
262
262
topLevelPackages. forEach { top ->
263
- jarTask. relocate(top, " com.launchdarkly.shaded." + top) {
263
+ // This special-casing for javax.annotation is hacky, but the issue is that Guava pulls in a jsr305
264
+ // implementation jar that provides javax.annotation, and we *do* want to embed and shade those classes
265
+ // so that Guava won't fail to find them and they won't conflict with anyone else's version - but we do
266
+ // *not* want references to any classes from javax.net, javax.security, etc. to be munged.
267
+ def packageToRelocate = (top == " javax" ) ? " javax.annotation" : top
268
+ jarTask. relocate(packageToRelocate, " com.launchdarkly.shaded." + packageToRelocate) {
264
269
excludePackages. forEach { exclude(it + " .*" ) }
265
270
}
266
271
}
You can’t perform that action at this time.
0 commit comments