Slackbot
09/28/2023, 2:54 PMVampire
09/28/2023, 3:17 PMcustomRuntime needlessly extends from customApi (which is already implied by depending on customImplementation) what is the concrete problem with that setup? The configurations look fine from a cursory lookVampire
09/28/2023, 3:22 PMjava-library plugin is apiElements or runtimeElements.
And accordingly in the respectively in the customCompile and customRuntime according attributes requested, so that the intended consumable configuration is selected.Vampire
09/28/2023, 3:23 PMcustomImplementation(project(":internal")) does not mean that it somehow magically depends on any of the custom... configurations which would not work anyway as they are not consumable. Which is probably also why you declare the dependencies on the "normal" configurations and also your custom configurations.Vampire
09/28/2023, 3:24 PMjava-library configurations are wired together: https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_configurations_graphVampire
09/28/2023, 3:25 PMPedro Lamarão
09/28/2023, 3:55 PMPedro Lamarão
09/28/2023, 3:56 PMcustomCompile and `compileClasspath`:
compileClasspath - Compile classpath for source set 'main'.
\--- project :intermediate
\--- project :base
customCompile - custom compile dependencies
\--- project :intermediate
+--- project :base
\--- project :internalPedro Lamarão
09/28/2023, 3:58 PMPedro Lamarão
09/28/2023, 4:01 PMextendsFrom to reduce the noise.Vampire
09/28/2023, 4:01 PMcompileClasspath and runtimeClasspath is only that in the former compileOnly is included and in the latter runtimeOnly. But api and implementation are included in both as you can see at the graphic I linked you to.Vampire
09/28/2023, 4:02 PMapiElements which does not contain implementation vs. runtimeElements which contains both.Vampire
09/28/2023, 4:03 PMorg.gradle.usage which is set to java-api vs. java-runtime.Vampire
09/28/2023, 4:05 PMcompileClasspath requests this attribute to be java-api while runtimeClasspath requests this attribute to be java-runtime.Pedro Lamarão
09/28/2023, 4:05 PMVampire
09/28/2023, 4:07 PMapiElements and runtimeElements, which are the consumable configurations. And there the former just extends api while the latter extends implementation and thus also api implicitly. So in the long run, yes.Pedro Lamarão
09/28/2023, 4:10 PMVampire
09/28/2023, 4:13 PM./gradlew application:dependencyInsight --dependency :intermediate --configuration customCompile which variant was selected and from ./gradlew intermediate:outgoingVariants you can see the published variants.Pedro Lamarão
09/28/2023, 4:19 PM