This message was deleted.
# community-support
s
This message was deleted.
v
If you do those lines in a precompiled script plugin, then
apply false
is useless, it is actually ignored and the plugin is applied. There is an issue that this should instead error out instead of just ignoring it. It also does not make sense, as
apply false
would be for adding the plugin to the script classpath, but when working on a precompiled script plugin, you add the plugin to the classpath by depending on it in the build script of the build that builds the plugin.
a
If it's not being pulled from
buildSrc
then would it get pulled in via a composite build? This is happening in the root build.gralde of a composite build, so Kotlin is being added to the classpath before this line somewhere, I assumed it was
buildSrc
since that's what was recently changed, so I believed it was being added by the Kotlin DSL in that script plugin.
v
Whether
buildSrc
or from a composite build does not change much in that regard. If the project you depend on has a dependency (other than
compileOnly
or similar) it will be on the classpath of the consumer, yes.
a
Sorry to clarify it's not in the consumption of the composite project it's failing, but in the composite project itself:
Copy code
├─buildSrc
│  └─build.gradle.kts (uses kotlin DSL)
├─myCompositeProject
|  └─build.gradle.kts (failing to apply kotlin plugin due to it already being in classpath)
├─build.gradle.kts
v
But still, if
myCompositeProject/build.gradle.kts
has a dependency on the Kotlin plugin so that your precompiled script plugin can use it and you apply it in the plugin with version, it is wrong. And
apply false
is wrong in that case anyway.
a
It's not being applied for the script plugin, it's being applied for subprojects of
myCompositeProject
, outside of the DSL
buildSrc
does nothing with Kotlin.
So
apply false
was being used to set the version for
myCompositeProject/project1/build.gradle.kts
v
Can you provide an MCVE, so that we don't talk about different things?
a
I'll try, I've been having issues reproducing the issue in anything but the publish task for some reason.
I found the issue and it's actually completely unrelated it looks like at some point this was no longer made a composite build. So much of what I said is no longer correct.
👌 1