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

Repackage annotation compiler dependencies using jarjar directly #2364

Closed
wants to merge 3 commits into from

Conversation

TWiStErRob
Copy link
Collaborator

@TWiStErRob TWiStErRob commented Sep 9, 2017

Description

Add two more steps to build:

  • repackage (change and fatjar packages)
  • ProGuard shrink (remove unused classes)

Sizes of compiler-4.2.0-SNAPSHOT.jar:

Name Size Comment
Original 72,239 raw classes from this module
Repackaged 2,648,476 (incl. Guava, Javapoet, Auto)
Proguarded 251,481 dontobfuscate,dontoptimize,shrink; keep all module code

The only drawback I see is the inclusion of jarjar JAR in the libs folder, only 1.3 is published on Maven Central.

Motivation and Context

Fixes #2059

@TWiStErRob
Copy link
Collaborator Author

Warning: I didn't test-run this change, only that the .jar file is built correctly and similar to the original.

@sjudd
Copy link
Collaborator

sjudd commented Sep 11, 2017

Thanks @TWiStErRob, working on testing this.

@sjudd
Copy link
Collaborator

sjudd commented Sep 11, 2017

For posterity, #2363 lets us use a gradle plugin, but requires modifying Glide's source to accomplish the same thing.

Copy link
Collaborator

@sjudd sjudd left a comment

Choose a reason for hiding this comment

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

I patched your cl and uploaded it (with the changes I've indicated here) to sonatypes SNAPSHOT. Then I created a sample app and added a dependency on the new snapshot. It's a little hard to tell because AS seems to ignore the various gradle cache configurations, but at least from the command line I was able to verify that the findbugs conflict mentioned in the attached issue is fixed after this change, the app builds successfully, and the expected Glide classes are generated.

Probably ok to merge this.

@@ -14,4 +26,73 @@ dependencies {
testCompile 'com.google.testing.compile:compile-testing:0.10'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the two testCompile lines (they're totally unused anyway).


compileOnly 'com.squareup:javapoet:1.9.0'
compileOnly 'com.google.auto.service:auto-service:1.0-rc3'

compile 'com.google.code.findbugs:jsr305:3.0.1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

compileOnly here is fine since these are just annotations anyway. Doing so will resolve the findbugs conflict as well as those with javapoet and auto-service.

@sjudd
Copy link
Collaborator

sjudd commented Sep 14, 2017

@TWiStErRob let me know if you want me to take this over, thank you for putting this up. Great idea! I really appreciate the help.

@sjudd
Copy link
Collaborator

sjudd commented Sep 15, 2017

Merged here: a0e388e. Thanks!

@sjudd sjudd closed this Sep 15, 2017
@TWiStErRob TWiStErRob deleted the jarjar branch September 23, 2017 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflicting dependencies in annotation processors
3 participants