Hi!
i have a custom plugin in my buildSrc that gathers 2 plugins i need, in my subprojects i include my custom plugin.
I configure pluginA in the subproject themselves
but pluginB is being configured in the buildSrc custom plugin as it is the same for every subproject
pluginB configuration:
npmPublish {
nodeHome.set(tasks.nodeSetup.flatMap { it.nodeDir })
packages {
register(“js”) {
version.set(“0.0.1”)
packageName.set(“coolio”)
files {
from(tasks.getByPath(“:GradlePluginTestProject1:generateTypeScript”))
from(tasks.getByPath(“:GradlePluginTestProject2:generateTypeScript”))
}
}
}
registries {
register(“nexus”) {
uri.set(uri(“http://registry”))
authToken.set(“token”)
}
}
}
my question is -
as you can see the files{} section has some hardcoded subprojects…
how can i make the files{} section be dynamically created according to all the subprojects that contains my custom plugin? (basically has the generateTypeScript task configured)
most of my subprojects doesnt have that plugin so no need to add them there.
I thought something like
subprojects.findAll { subproject → subproject.plugins.hasPlugin(‘generateTypeScript’) }
but i cant seem to figure out how to use it in the file{} section