https://kotlinlang.org logo
#compiler
Title
# compiler
j

Justin Tullgren

09/21/2023, 2:36 PM
Hi, is there a way to use gradle’s
includeBuild
and
dependencySubstition
to avoid having the kotlin compilation process pull a compiler plugin from a remote repository (like
mavenLocal
) so that we don’t have to publish the
kotlin compiler plugin
before debuggin?
the subplugin is always fetched instead of using the substituted module from the included build
n

natario1

09/21/2023, 3:00 PM
With included builds, AFAIK you just have to make sure that the maven coordinates match and there’s no need to use
dependencySubstitution
explicitly (though you could if needed). I don’t think there’s anything special about how compiler plugins are resolved, your scenario used to work fine for me.
j

Justin Tullgren

09/21/2023, 3:01 PM
ok, i’ll see if I can find out what might be causing the download then. thanks!
ya I can’t seem to make this work. the artifacts are all matched and I even tried setting the projects name in gradle but no luck. Any other thoughts would be appreciated but I am not blocked if you don’t have an idea. just kind of a pain.
n

natario1

09/21/2023, 3:18 PM
For help, I’d ask in #gradle . To solve on my own, I guess I’d go through the
includeBuild
documentation in Gradle and check what’s wrong.
project.group
,
project.version
and the module name must match the Gradle dependency as added by your gradle plugin
j

Justin Tullgren

09/21/2023, 3:18 PM
ya they do, i’ll ask there, thanks!
v

Vampire

09/21/2023, 4:58 PM
Do an
gw outgoingVariants
on the producer to see what it producers
j

Justin Tullgren

09/21/2023, 7:08 PM
i ran
./gradlew outgoingVariants
on the build i am including. It says there are none. Did i run the command in the right place? @Vampire
v

Vampire

09/21/2023, 7:11 PM
Maybe not? Or maybe it is like dependencies and not runs on all projects in the build, I'm not sure, in the sauna right now. :-)
j

Justin Tullgren

09/21/2023, 7:12 PM
lol okay
v

Vampire

09/21/2023, 7:31 PM
We'll maybe see if you finished the MCVE. :-)
j

Justin Tullgren

09/21/2023, 7:31 PM
yup
ya reproduced, it doesn’t use the build artifact from the includedBuild but if i publish to maven local it works
IncludeBuildIssueExample.zip
v

Vampire

09/21/2023, 8:35 PM
Hea, as I suspected,
gw :buildLogic:plugin-gradle:outgoingVariants
and
gw :buildLogic:plugin-kotlin:outgoingVariants
show the respecting outgoing variants.
j

Justin Tullgren

09/21/2023, 8:37 PM
so i am ignorant of this, how do we use that information to include the sibling project?
v

Vampire

09/21/2023, 8:43 PM
It's just to see the capabilities that are published to see you used the right artifact coordinates. For the include problem I already told you how in the other thread before you even posted the MCVE, you just said it does not work which is not true, at least not in your MCVE 🙂