From 040baf71b1418bbb9286df9de02230d28b3b4405 Mon Sep 17 00:00:00 2001 From: Zongle Wang Date: Wed, 28 Feb 2024 22:57:32 +0800 Subject: [PATCH] Support publishing Gradle plugin marker artifact (#766) * Configure publishing plugin https://plugins.gradle.org/docs/publish-plugin * Compat old users * Fix legacy namespace --- plugins/gradle/build.gradle | 18 ++++++++++++++++++ .../META-INF/gradle-plugins/robovm.properties | 1 + 2 files changed, 19 insertions(+) mode change 100755 => 100644 plugins/gradle/src/main/resources/META-INF/gradle-plugins/robovm.properties diff --git a/plugins/gradle/build.gradle b/plugins/gradle/build.gradle index 4ea16f6d7..7ceb7d61b 100644 --- a/plugins/gradle/build.gradle +++ b/plugins/gradle/build.gradle @@ -1,5 +1,6 @@ plugins { id "com.github.johnrengelman.shadow" version "8.1.0" + id "com.gradle.plugin-publish" version "1.2.1" id 'java' id 'groovy' id 'maven-publish' @@ -44,6 +45,19 @@ dependencies { testImplementation group: 'junit', name: 'junit', version: '4.11' } +gradlePlugin { + website = "https://mobivm.github.io" + vcsUrl = "https://github.com/MobiVM/robovm" + plugins { + create("robovm") { + id = "com.mobidevelop.robovm" + implementationClass = "org.robovm.gradle.RoboVMPlugin" + displayName = "RoboVM Gradle Plugin" + description = "The RoboVM Gradle Plugin provides a way to build RoboVM apps using Gradle." + } + } +} + publishing { publications { mavenJava(MavenPublication) { @@ -125,3 +139,7 @@ signing { assemble.dependsOn('shadowJar') publishToMavenLocal.dependsOn('shadowJar') publish.dependsOn('shadowJar') + +tasks.withType(AbstractPublishToMaven).configureEach { + dependsOn(tasks.withType(Sign)) +} \ No newline at end of file diff --git a/plugins/gradle/src/main/resources/META-INF/gradle-plugins/robovm.properties b/plugins/gradle/src/main/resources/META-INF/gradle-plugins/robovm.properties old mode 100755 new mode 100644 index c01d52cc8..b1f1fc900 --- a/plugins/gradle/src/main/resources/META-INF/gradle-plugins/robovm.properties +++ b/plugins/gradle/src/main/resources/META-INF/gradle-plugins/robovm.properties @@ -1 +1,2 @@ +# Keep this file here for legacy plugin id, to compat users applying this plugin via buildscript classpath. implementation-class=org.robovm.gradle.RoboVMPlugin \ No newline at end of file