Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Conversation

@drichelson
Copy link
Contributor

More v2 changes. See comments in code


task wrapper(type: Wrapper) {
gradleVersion = '2.0'
gradleVersion = '2.14-rc-3'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the version mentioned here: https://github.com/johnrengelman/shadow

classifier = ''

// Shade all jars except for launchdarkly
relocate('com', 'com.launchdarkly.shaded.com') {
Copy link
Contributor Author

@drichelson drichelson Jun 2, 2016

Choose a reason for hiding this comment

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

The potential problem with shading Gson is that we return a Gson type (JsonElement) from our public interface: https://github.com/launchdarkly/java-client/blob/fa61ceb5f343c53db01f88b417a623575ab9fc58/src/main/java/com/launchdarkly/client/LDClient.java#L298-L298

This means that if a user's code already imports Gson this JsonElement is a different type than they might be expecting.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I hadn't considered that when I made the suggestion to shade Gson. I think we should not shade it then-- leaking a shaded class into an external interface isn't a good practice.

In addition to just having the wrong type, interacting with the JsonElement is going to be hard-- you'll have to manipulate the shaded API, which exposes more shaded footprint.

Choose a reason for hiding this comment

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

It might be appropriate to reconsider this approach. In my project, SBT (sbt-assembly) got confused by launchdarkly-client depending on com.google.code.gson:gson, but both artifacts included com/google/gson/Gson.class etc.

@drichelson drichelson changed the title dr/v2 More v2 changes Jun 3, 2016
relocate('okhttp3', 'com.launchdarkly.shaded.okhttp3')
relocate('okio', 'com.launchdarkly.shaded.okio')
relocate('org', 'com.launchdarkly.shaded.org') {
exclude("org.slf4j.*")
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch on excluding the logging facade.

@jkodumal
Copy link
Contributor

jkodumal commented Jun 5, 2016

👍

@drichelson drichelson merged commit 056bdc6 into v2 Jun 7, 2016
@drichelson drichelson deleted the dr/v2 branch June 7, 2016 19:06
eli-darkly added a commit that referenced this pull request Mar 26, 2018
add more flag evaluation unit tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants