-
Notifications
You must be signed in to change notification settings - Fork 737
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 Issue #1536 #1587
Fix Issue #1536 #1587
Conversation
Remove "provided" scope from com.google.auto.value:auto-value. Scope provided seems to cause build system consumers to expect that auto-value is present on the classpath somewhere at runtime, while nothing is providing it. I tested this locally with gradle and this seems to be the smallest change that fixes #1536. Gradle properly handles the auto-value dependency without requiring it to be shaded.
It might make sense to have a compile/runtime dependency only on |
Also bump auto-value to 1.7. Fixes #1536.
Ok, if I understood you correctly, this next commit is in line with what you proposed, and still seems to work in testing error prone against a gradle project through the net.ltgt.errorprone gradle plugin. It's worth noting that I saw this comment, #1398 (comment) , and I've been testing using |
Thanks. I was proposing to put |
I tried this diff (and then removing com.google.auto.value:auto-value as a dependency in the various pom.xml files), but this results in some test failures I don't quite understand:
|
Sorry about that. I hit a similar problem with another project, so I think I know what's up. As soon as you add the first entry to This is probably the more sensible behavior. However, if a project currently depends on finding annotation processors or plugins in the regular classpath, it produces a breakage. The fix is to change the setup for Error Prone itself to list it in However, I have no idea what additional challenges that might present, so I completely understand if you want to stick with (You can see where I unknowingly introduced and unknowingly fixed the problem in another project.) |
My understanding so far is that adding the annotationProcessorPaths section to pom.xml adds a The test failures are because the tests were relying on being able to find the locally compiled ErrorProne in the classpath, ex. https://github.com/google/error-prone/blob/master/core/src/test/java/com/google/errorprone/ErrorProneJavacPluginTest.java#L302. As I understand it, the fix here would be to add the target/ directory to If anyone has any ideas on how to accomplish the above I'd be happy to try them and modify the PR accordingly if any of the ideas pan out, otherwise I think the PR is good as-is. As a side note I noticed I had committed the diffutils change and I can either leave that in the PR as-is or remove that if you have any comments on that one way or the other. My testing against a gradle project using JDK 11 and using many |
I can't understand why changing how the tests are compiled (looking up annotation processors from |
Ok, understood: same change needs to be done with auto-service: use BTW, should auto-service-annotations and auto-value-annotations be shaded into the |
Thanks for taking a look and explaining the issue @tbroyer. I've tested moving auto-value and auto-service into annotationProcessorPaths and it works in my local testing and passes the unit tests. I've also modified the shade config to include the auto-value and auto-service annotations. |
pom.xml: * Add maven-enforcer-plugin and enforce a min maven ver. of 3.0.5 * Upgrade maven-javadoc-plugin to 3.2.0 * Explicitly specify Java source version 8 for maven-javadoc-plugin * Upgrade maven-site-plugin to 3.9.0 * Upgrade maven-project-info-reports-plugin to 3.0.0 by removing its plugin block These changes fix issues encountered while working through getting util/generate-latest-docs.sh working again. core/pom.xml: * Add an annotationProcessorPaths block for the run-annotation-processor maven profile to fix util/generate-latest-docs.sh. docgen/pom.xml: * Remove unused dependency block for auto-service docgen_processor/pom.xml: * Remove unused dependency block for auto-value * Add a build section to enable annotation processing for auto-service examples/plugin/maven/sample_plugin/pom.xml: * Upgrade auto-service to 1.0-rc6 * Add an annotationProcessorPaths block to maven compiler plugin config util/generate-latest-docs.sh: * Add single quotes to prevent exclamation shell expansion
Anything left to do on this PR before merge? |
and move the processor dependencies to `<annotationProcessorPaths>`. Fixes #1587 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=311225943
and move the processor dependencies to `<annotationProcessorPaths>`. Fixes #1587 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=311225943
Remove "provided" scope from com.google.auto.value:auto-value.
Scope provided seems to cause build system consumers to expect that
auto-value is present on the classpath somewhere at runtime, while
nothing is providing it.
I tested this locally with gradle and this seems to be the smallest
change that fixes #1536. Gradle properly handles the auto-value
dependency without requiring it to be shaded.