Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix duplicate class problem, when the java-lib module is desired to be embedded in a far-aar library #30

Merged
merged 2 commits into from
Jul 21, 2019

Conversation

kanat
Copy link
Contributor

@kanat kanat commented Jul 16, 2019

By default embed configuration pulls the internal 'java-library' module dependencies into the fat-aar, which is not a desired behavior by default.

For instance, if you add dagger dependency to :example:lib-java:build.gradle file, that dagger dependency will be included into your final fat-aar.

@kezong
Copy link
Owner

kezong commented Jul 17, 2019

There is such a problem.
I think #15 is the same problem.
Everyone's needs may be different, not everyone wants exclude the dependencies.
I think it would be better to add a new parameter in build.gradle, like this:

fataar {
    transitive = false  // default is true;
}

Could you improve the code?

@kanat
Copy link
Contributor Author

kanat commented Jul 17, 2019

Everyone's needs may be different, not everyone wants exclude the dependencies.

I would agree with you if that was true for any module, but currently transitive dependencies are included only if they were added to java-library, and excluded if they were added to com.android.library.

No need to add custom field. Gradle's configurations already have such a field, so you can switch it by adding this line to your build.bradle:
configurations.embed.transitive = false

Anyway, I guess it's better to add that information to README

@kezong
Copy link
Owner

kezong commented Jul 17, 2019

Transitive dependencies are also included by remote repository with pom file.
In this way, the default value of transitive is false,which may be more appropriate.
At least, com.android.library,java-library and remote repository are all exclude the dependencies.
Thanks for your comments, I will merge the pull request later and update README and example the next time I upgrade the plugin.

@kezong kezong merged commit a2eda97 into kezong:master Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants