From 7a2793c2064bd5e3e3c3bb65857406ea5577b357 Mon Sep 17 00:00:00 2001 From: Atri Date: Fri, 3 Oct 2025 18:38:24 -0400 Subject: [PATCH] fix: Reintroduce plugin deployment --- README.md | 2 ++ build.gradle.kts | 44 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a8579df..59c64c7 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ To begin using this plugin, you'll need to add the plugin to your `settings.grad under the hood. If you attempt to place the plugin in your typical `build.gradle` or `build.gradle.kts` files, it will not work. ### Kotlin + ```kotlin // settings.gradle.kts plugins { @@ -62,6 +63,7 @@ plugins { id 'xyz.atrius.compositor' version '0.0.1' } ``` + #### Additional Note diff --git a/build.gradle.kts b/build.gradle.kts index 6f5fdf4..06f5b8f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import com.vanniktech.maven.publish.GradlePlugin +import com.vanniktech.maven.publish.JavadocJar plugins { `java-gradle-plugin` @@ -30,7 +32,19 @@ kotlin { jvmToolchain(17) } +val projectWebsite: String by project +val license: String by project +val licenseLink: String by project + mavenPublishing { + + configure( + GradlePlugin( + javadocJar = JavadocJar.Javadoc(), + sourcesJar = true, + ) + ) + publishToMavenCentral(automaticRelease = true) signAllPublications() @@ -41,10 +55,6 @@ mavenPublishing { ) pom { - val projectWebsite: String by project - val license: String by project - val licenseLink: String by project - name = rootProject.name url = projectWebsite @@ -57,6 +67,32 @@ mavenPublishing { } } +publishing { + // Both plugins should be deployed as a single artifact to ensure they can be setup automatically + publications { + + create("Compositor") { + from(components["java"]) + + groupId = group.toString() + artifactId = rootProject.name + version = property("version") as String + + pom { + name = rootProject.name + url = projectWebsite + + licenses { + license { + name = license + url = licenseLink + } + } + } + } + } +} + gradlePlugin { // Since we provide two plugins together that we want deployed as a single plugin, we should disable this to avoid // publishing either of them separately when running through deployment pipelines.