Open Nek-12 opened 1 month ago
@Nek-12 Did you come up with a solution for this? I do something very similar and I'm running into the same issue. It's happening since version 0.29.0, not with 0.28.0 or earlier.
My use case: in my build config I have an utility function to configure publishing for all subprojects.
fun Project.configurePublishing() {
plugins.apply("com.vanniktech.maven.publish")
publishing {
repositories {
maven(url = "...")
}
}
mavenPublishing {
pom { coordinates(LibConfig.groupId, project.name, LibConfig.versionName) }
}
}
It is then used like this:
subprojects {
configurePublishing()
}
I did, a workaround that worked was to configure after evaluation: https://github.com/respawn-app/FlowMVI/blob/50676f0291c05ee811d6594da6dc2ecc8cf2d319/build.gradle.kts#L44
I have configured the plugin to be configured in the root project for all subprojects:
I used this trick successfully to configure the compose compiler plugin (if it is applied) for each project module, however it seems that the publishing plugin does some illegal stuff in the
signAllPublications()
that cannot be executed in the plugin configuration block. If I remove theplugins.configureEach
clause, then the extension is not configured at all.Is there any hack I can shove in or other way to configure the publishing plugin once and then release all subprojects that have the publishing plugin applied with a single task? Not all projects have to be published.