From a19e0bb99432c61972cf2dbdb3ce4f6b503c2cc2 Mon Sep 17 00:00:00 2001 From: Lamberto Basti Date: Fri, 8 Dec 2023 14:09:17 +0100 Subject: [PATCH] Refactor snapshot versioning and deployment process v2 (cherry picked from commit 6ffafc5161e1d4dfab9e3dfa90c8f65ecbe4cbfb) --- plugin/build.gradle.kts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index baf9d433..38838086 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -101,30 +101,19 @@ tasks { patchPluginXml { pluginId = pkgsPluginId - version = when { - versionString.endsWith("-SNAPSHOT") -> - "${versionString.removePrefix("-SNAPSHOT")}.$snapshotMinorVersion" - - else -> versionString - } + version = versionString.replace("-SNAPSHOT", ".$snapshotMinorVersion") } val buildShadowPlugin by registering(Zip::class) { group = "intellij" from(shadowJar) { - rename { - "package-search-plugin-" + when { - versionString.endsWith("-SNAPSHOT") -> - versionString.replace("-SNAPSHOT", ".$snapshotMinorVersion") - - else -> versionString - } + ".jar" - } + rename { "packageSearch.jar" } } from(tooling) { rename { "gradle-tooling.jar" } } into("$pkgsPluginId/lib") - archiveFileName = "packagesearch-plugin.zip" + archiveFileName = "packageSearch-${project.version}.zip" + .replace("-SNAPSHOT", ".$snapshotMinorVersion") destinationDirectory = layout.buildDirectory.dir("distributions") }