-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 #63: Use auto-value for Event classes. #87
Conversation
@omo Thanks! |
} | ||
|
||
dependencies { | ||
compileOnly "com.google.auto.value:auto-value:1.0-rc1+" |
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.
There should already be a provided
configuration available here.
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.
What does it mean? When there is only a dependencies section like following:
dependencies {
provided "com.google.auto.value:auto-value:1.0-rc1+"
}
I got this error:
:sample-app:packageDebug
Error: duplicate files during packaging of APK /Users/morrita/w/RxAndroid/sample-app/build/outputs/apk/sample-app-debug-unaligned.apk
Path in archive: META-INF/services/javax.annotation.processing.Processor
Origin 1: /Users/morrita/.gradle/caches/modules-2/files-2.1/com.google.auto.service/auto-service/1.0-rc1/f4f5ad098bf9a3c4fc95c15214c4ea014c38ac39/auto-service-1.0-rc1.jar
Origin 2: /Users/morrita/.gradle/caches/modules-2/files-2.1/com.google.auto.value/auto-value/1.0-rc1/95f1e38ae958b9b380846886913b1974065be454/auto-value-1.0-rc1.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
}
:sample-app:packageDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sample-app:packageDebug'.
> Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor
File 1: /Users/morrita/.gradle/caches/modules-2/files-2.1/com.google.auto.service/auto-service/1.0-rc1/f4f5ad098bf9a3c4fc95c15214c4ea014c38ac39/auto-service-1.0-rc1.jar
File 2: /Users/morrita/.gradle/caches/modules-2/files-2.1/com.google.auto.service/auto-service/1.0-rc1/f4f5ad098bf9a3c4fc95c15214c4ea014c38ac39/auto-service-1.0-rc1.jar
What's wrong?
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.
Well, the error means that there is actually a provided
configuration that someone gives us but it doesn't work as we expect. It does pull auto-value related dependencies into our sample-app somehow. Hmm.
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.
OK, it comes from this guy
https://github.com/nebula-plugins/gradle-extra-configurations-plugin/blob/gradle-1.12/src/main/groovy/nebula/plugin/extraconfigurations/ProvidedBasePlugin.groovy
And it does what we don't want - Making compile
depending on provided
:-(
I think the workaround in this change is reasonable at this point, but probably we should talk to
nebula-plugin's team.
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, that's fine. At the very least, you should remove the '+' from the version. Wildcard dependencies are bad news bears!
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.
Done!
@JakeWharton Any chance to merge this as well? |
Later. Out and about.
|
} | ||
|
||
dependencies { | ||
compileOnly "com.google.auto.value:auto-value:1.0-rc1" |
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.
Once we get this converted to an Android library (#81) we'll be able to use the apt
plugin and actually see the generated source in the IDE so it doesn't appear red.
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.
Fix #63: Use auto-value for Event classes.
Should we stick to the 2 thumbs rule before landing PRs? |
For adding new functionality sounds reasonable so we have more than one For small fixes not sure its too much overhead?
|
@mttkay See #87 (diff) |
@mttkay 2 thumbs up is a good rule. |
@hamidp I'm stealing this from you ;-o