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
Copy code
apply<LibraryCommonPlugin>()
but one below is not working
Copy code
plugins {
id("libraryPlugin")
}
is there any way to do so?
c
Chris Lee
10/24/2022, 2:15 PM
the second example uses the plugin ID that you chose in your build.gradle.kts 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.