Quarkus source set naming not aligned with the Gradle convention? #47287
jmini
started this conversation in
Design Discussions
Replies: 1 comment
-
For now have a solution working where I have a gradle module where I run the gradle plugin Of course I think that not using the usual gradle conventions inside quarkus remains open for discussion… |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When checking at the source set added to a gradle project when the quarkus plugin is used, I see this:
integrationTest
main
native-test
quarkus-generated-sources
quarkus-test-generated-sources
test
I have the feeling the gradle ecosystem is more using camelCase notation and not dash-case
Use case:
My concrete issue comes from the need to integrate the
com.google.protobuf
plugin.The idea would be to keep proto generation is handled by Quarkus itself (as indicated by @cescoffier in #27388 (comment) or #36074 (comment)) but add an other protobuf generation with the protoc-gen-doc plugin to generate documentation.
The generation with a command line works great:
But I wanted to use the gradle variant which rely on the
com.google.protobuf
plugin to have something integrated in the build.Issue:
Currently the build is failing with:
I think it would make sense for quarkus to adhere to the convention used in the gradle ecosystem and use following source set:
nativeTest
instead ofnative-test
quarkusGeneratedSources
instead ofquarkus-generated-sources
quarkusTestGeneratedSources
instead ofquarkus-test-generated-sources
This would also aligned with the configurations you already have:
nativeTestAnnotationProcessor
nativeTestCompileClasspath
nativeTestCompileOnly
nativeTestImplementation
nativeTestRuntimeClasspath
nativeTestRuntimeOnly
quarkusGeneratedSourcesAnnotationProcessor
quarkusGeneratedSourcesCompileClasspath
quarkusGeneratedSourcesCompileOnly
quarkusGeneratedSourcesImplementation
quarkusGeneratedSourcesRuntimeClasspath
quarkusGeneratedSourcesRuntimeOnly
quarkusTestGeneratedSourcesAnnotationProcessor
quarkusTestGeneratedSourcesCompileClasspath
quarkusTestGeneratedSourcesCompileOnly
quarkusTestGeneratedSourcesImplementation
quarkusTestGeneratedSourcesRuntimeClasspath
quarkusTestGeneratedSourcesRuntimeOnly
I analyzed it and in my opinion the way the
com.google.protobuf
is trying to find the configuration associated with a sourceSet by just guessing the name is wrong:https://github.com/google/protobuf-gradle-plugin/blob/6dedfa7c67322ba36a2362085ffed9742cefdcdb/src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy#L194-L199
using this Utils:
https://github.com/google/protobuf-gradle-plugin/blob/6dedfa7c67322ba36a2362085ffed9742cefdcdb/src/main/groovy/com/google/protobuf/gradle/Utils.groovy#L49-L53
There is a gradle API to retrieve the configuration associated with a sourceSet:
https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/SourceSet.html
*
getCompileOnlyConfigurationName()
*
getImplementationConfigurationName()
I have opened google/protobuf-gradle-plugin#777 to see if there is a reaction on their side.
Nevertheless, even if my problem might be fixable in the
protobuf-gradle-plugin
, I think that Quarkus should be closer to what the rest of the gradle ecosystem is doing and use camelCase instead of dash-case for the sourceSets it adds to the gradle project.Maybe related?
Beta Was this translation helpful? Give feedback.
All reactions