-
Notifications
You must be signed in to change notification settings - Fork 10.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
guava-gwt should publish Gradle module metadata or somehow fix POM #7134
Comments
Sorry for not getting to this sooner. Thanks for the easy repro. I have a fix on the way in #7153. It does seem interesting that GWT would use the "runtime" configuration for its compilation. I guess GWT's runtime and compile time aren't as cleanly separable, since the output of compilation contains exactly what will be used at runtime. I could maybe see having GWT us "compile-time" instead (as an acknowledgment that some people like to omit source-retention annotations at runtime), but I could also believe that that causes problems of its own. And maybe there's a way to use the union of those, but maybe that causes problems, too :) Anyway, I'm happy to just fix it on our end. |
The thing is that GWT loads everything from its own classpath when you run the compiler or codeserver, so for the GWT tooling itself you'd rather use the runtime dependencies (I'm not sure it makes much difference, I haven't checked though); and this also applies to other dependencies that "enhance" the compilation (through GWT generator and linker mechanisms), particularly their transitive dependencies that might not be GWT-aware. |
Description
Using guava-gwt from Gradle, when resolving a "runtime" configuration, the j2objc-annotations dependency is missing. This is because it's declared in the
jreApiElements
variant but not in thejreRuntimeElements
one.When using Maven, or explicitly disabling Gradle module metadata, the dependency will be there as it's declared with the default
<scope>compile</scope>
in Maven (Maven lacking an equivalent to Gradle'scompileOnlyApi
).As a workaround, the dependency can be explicitly added to the project.
sscce.zip
Example
Expected Behavior
Compilation should succeed.
Actual Behavior
Compilation fails, GWT complaining about the j2objc annotations.
Edit
build.gradle.kts
to uncomment the j2objc-annotations dependency and rebuild, now it should compile without error.You can also run
./gradlew dependencies
and compare thecompileClasspath
andruntimeClasspath
dependency trees (note that the latter will also containgwt-dev
and all its dependencies):Packages
No response
Platforms
GWT
Checklist
The text was updated successfully, but these errors were encountered: