-
Notifications
You must be signed in to change notification settings - Fork 274
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
Protos from java-library project are not extracted for downstream dependencies #363
Comments
After a very involved session of figuring out how the newfangled world is supposed to work, we figured out how the plugin is supposed to get the input files:
The plugin will need to create a configuration like that and then use it in ProtobufPlugin when configuration inputs. This is mirroring what is done with compileClasspath. We would need something similar to mirror That also allows us to use the output folders directly instead of requiring the output jar. Although we may need some other code changes to handle folders (doesn't seem like it, but maybe). |
Awesome! This sounds really promising, thanks for that hard work to find this in the guts of Java plugin :-) |
@voidzcy, thinking more about the system property, I think we should be fine to drop it and just use RESOURCES unconditionally. The system property is there because of a performance problem with javac but we need folders anyway so I don't think it really does much for us to use JAR. |
@radimk Are you sure the issue occurs when using Also, this issue is likely to be the same one as #242 (people observed error for |
@voidzcy you're right. |
Please try out 0.8.11 release, we did some work regarding this issue. Please let us know if there is anything else related to this issue. |
Works now. Thank you. |
Gradle 6.0.1, Java 8, protobuf-plugin 0.8.10
I have a protobuf
a.proto
defined in project:lib
and second protobufb.proto
in project:app
that has dependencycompile project(':lib')
. My second protobuf importsa.proto
and relies ona.proto
being extracted intoapp/build/extracted-include-protos/main/a.proto
byextractIncludeProto
task. This works:lib
project uses 'java' plugin but it doesn't if it uses 'java-library' plugin.This can be a duplicate of issue #338 but the important part about java-library being used for upstream dependency is not mentioned there.
The problem is related to how Gradle resolves
compileClasspath
of lib project. When it is defined likeThe entry from compileClasspath will be resolved as JAR:
2019-12-05T23:41:58.416+0100 [DEBUG] [org.gradle.api.Task] Extracting protos from /home/rkubacki/tmp/protobuf_bug/lib/build/libs/lib.jar to /home/rkubacki/tmp/protobuf_bug/app/build/extracted-include-protos/main
When 'java-library' and api configuration is used:
it will get output folder containg classes. That's why a.proto will not be found and copied and thus it is missing when generateProto runs.
The text was updated successfully, but these errors were encountered: