Create reusable publishing plugin and let build depend on it for publishing

Hi,

I am currently writing a PublishingPlugin that pre-configures the publishing task for my projects with common settings like target repository, POM information, and artifacts.

Now, I’d like to use the exact same PublishingPlugin to publish the plugin itself :slight_smile: I.e. I would need to be able to access the sources/plugin from my build.gradle.kts / buildSrc folder.

Is something like this achievable, or do I need to duplicate the publishing code? I am thinking about whether this would be possible with a composite build, but I am struggling about where the plugin definition would need to go, etc.

Thanks in advance,
Mario