Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Add a new submodule to build a client bundle. #601

Closed
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions jaeger-client/build.gradle
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 {
Expand All @@ -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*
Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Author

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.

* 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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer another name - bundle makes me think OSGi 😄 , but not sure what might be better. Could be something simple like all - but will let others comment.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all sounds about right to me.

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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shadowJar is only being triggered in the thrift case when jaeger-crossdock is being built. Based on what you wrote, it sounds like we should do the same here? :)

Copy link
Contributor

@objectiser objectiser Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it should be dependent on jaeger-crossdock build - ideally it should just be built when the non-shaded artifact is being built.

Copy link
Author

Choose a reason for hiding this comment

The 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.