Closed timplifier closed 4 months ago
We need more information to understand the request. Could you please provide more context about what you want to achieve?
If we receive a clear use case description, we may be able to suggest a workaround.
Sorry, I'm not sure if I understand your use case.
First of all, the plugin is published when the publishPlugins
task is executed. If you don't want to publish it, you can just skip/exclude the task from your workflow.
Second, if the plugin is never intended to be published, can it be transformed to Convention Plugin?
I mean, this publishPlugins
task is not created for every separate plugin, but for all plugins defined under gradlePlugin
block. Take a look at this build-logic module https://github.com/Timbermir/clean-wizard/tree/2.0.0/build-logic
publishPlugins task is not created for every separate plugin, but for all plugins defined under gradlePlugin block.
If you don't want to publish a plugin, then why is the plugin registered in the publishing block?
If you want to publish plugins separately, you can use multi-project setup.
Yup, already did it. Created another composite build, works like a charm, thank you for your time.
Generating Gradle tasks for publishing should be determined whether plugin should be published or not. It would be good if you are developing custom plugin because having composite build with your plugins that are intended for internal use are also gonna have those publish tasks because you have applied gradle-publish plugin. Because of that, you would need to create separate module just to publish the plugin. Of course I rely on publishPlugins task.
Expected Behavior
Current Behavior
Currently, it is not possible to determine whether plugin should be published or not if you have multiple plugins inside one .build.gradle.kts lets say with gradle-publish plugin inside it. I had to create a separate module just for the sake of publishing. Moreover, I need to duplicate the code for plugins because I also have to test the plugin locally.
Context
I want to make it easier to manage which plugins are gonna be published or not by using simple shouldPublish property that is true or false. I think that it is pretty much easy to make and I can do it myself if you allow me to.