-
Notifications
You must be signed in to change notification settings - Fork 231
Add a new submodule to build a client bundle. #601
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
apply plugin: 'com.github.johnrengelman.shadow' | ||
|
||
description = 'Convenience module to be used by instrumented applications' | ||
|
||
dependencies { | ||
|
@@ -7,3 +9,28 @@ dependencies { | |
|
||
testCompile group: 'junit', name: 'junit', version: junitVersion | ||
} | ||
|
||
/* Shaded the same libraries as jaeger-thrift, | ||
* leaving the slf4j dependency in place, as a *requirement* | ||
* for a standalone fat jar. */ | ||
shadowJar { | ||
relocate 'com.google.gson' , 'io.jaegertracing.vendor.com.google.gson' | ||
relocate 'com.twitter' , 'io.jaegertracing.vendor.com.twitter' | ||
relocate 'okhttp' , 'io.jaegertracing.vendor.okhttp' | ||
relocate 'okio' , 'io.jaegertracing.vendor.okio' | ||
relocate 'org.apache' , 'io.jaegertracing.vendor.org.apache' | ||
relocate 'org.slf4j' , 'io.jaegertracing.vendor.org.slf4j' | ||
classifier 'bundle' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would prefer another name - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
dependencies { | ||
exclude(dependency('org.projectlombok:lombok')) | ||
exclude(dependency('org.codehaus.mojo:animal-sniffer-annotations')) | ||
} | ||
} | ||
|
||
artifacts { | ||
archives(shadowJar.archivePath) { | ||
builtBy shadowJar | ||
} | ||
} | ||
|
||
tasks.check.dependsOn tasks.shadowJar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This wasn't required in the thrift usecase - was the shadowJar task not being triggered? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure it should be dependent on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, then this line should stay, as it builds the shaded artifact right after the non-shaded one was built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems out of date now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although not sure whether the slf4j-api should be shaded, as there is no slf4j logging impl as part of this uber jar, so would need to pick it up from the app's dependencies. Not sure what the impact of shading the api would have on picking up an impl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was wondering about this myself later on (whether shading it or not). So I think I will update the code to not shade it at all.