-
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
GenerateProto depends on compile tasks #578
Comments
Note that Note that even if we avoid the unnecessarily dependencies like |
Yes, it should work as you describe. The |
No, that's not what I'm saying. I'm saying that
No matter the approach, .proto dependencies often contain class files, because in the normal case the same .jar files contain the .proto files and .class files. |
rougsig and I discussed separately and |
Background
Test project structure (link):
:generateProto
executed a bunch of unnecessary tasks::lib-core:compileJava
,:proto-android:compileDebugJavaWithJavac
,:proto-java:compileJava
,:proto-kotlin:compileKotlin
,:proto-kotlin:compileJava
,:pure-android:compileDebugJavaWithJavac
,:pure-java:compileJava
,:pure-kotlin:compileKotlin
,:pure-kotlin:compileJava
It just compile all dependencies, without any reason.
How it works now
Protobuf gradle plugin create
compileProtoPath
configuration that extends fromimplementation
andcompileOnly
.It's quite user-friendly, because all you project dependencies provides proto files by default. No need to duplication dependency for
compileProtoPath
configuration.i.e.
What wrong
Gradle scan from test project for generate proto task.
Generate proto task resolves
compileProtoPath
configuration.compileProtoPath
configuration resolvesimplementation
andcompileOnly
configuration. As result we have compiled or downloaded all project's dependencies.This is not good. It costs build time a lot. (that looks real, if project have a lot of dependencies #551).
Expected result
Generate proto task does not compile and download all of the project's dependencies. It should only work with dependencies marked as path dependencies.
Changes
The
compileProtoPath
configuration does not extends fromimplementation
andcompileOnly
configurations.Breaking changes
If
compileProtoPath
configuration does not extends fromimplementation
andcompileOnly
configurations, user should declarate all dependencies for generate proto task withcompileProtoPath
configuration. i.e.The text was updated successfully, but these errors were encountered: