nuhkoca
10/24/2022, 2:14 PMGradle
plugin in buildSrc and would like to use it inside plugins block in one of precompiled scripts but the IDE throws an exception like my plugin is not found unless I declare it as follows
apply<LibraryCommonPlugin>()
but one below is not working
plugins {
id("libraryPlugin")
}
is there any way to do so?Chris Lee
10/24/2022, 2:15 PMnuhkoca
10/24/2022, 2:16 PMnuhkoca
10/24/2022, 2:16 PMgradlePlugin {
plugins {
register("LibraryCommonPlugin") {
id = "libraryPlugin"
implementationClass = "LibraryCommonPlugin"
}
}
}
Chris Lee
10/24/2022, 2:17 PMnuhkoca
10/24/2022, 2:19 PMVampire
10/24/2022, 2:35 PMLibraryCommonPlugin
and your precompiled script plugin are both in buildSrc
? This cannot work, it is kind of a hen-and-egg situation. To generate the type-safe accessors for the Kotlin DSL precompiled script plugin, it needs to apply the plugin to a dummy project, but it cannot apply the plugin because it isn't built yet as it is built by the same build. Applying by class is not a problem, because there it is only needed at runtime.
You can apply one precompiled script plugin from a sibling precompiled script plugin though, but I assume that is an explicitly supported special case.nuhkoca
10/24/2022, 2:45 PM