From 922bb27f5343f62be12fc653b3be71b4914e5be9 Mon Sep 17 00:00:00 2001 From: londonbrown Date: Mon, 5 Dec 2022 09:13:37 -0800 Subject: [PATCH 1/2] Change versioning to include build metadata after patch --- build.gradle.kts | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 745ed78..f2c340f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -168,12 +168,34 @@ tasks { fun readResource(name: String) = file("resources/$name").readText() /** - * Function which creates a plugin version. + * Function which creates a plugin version in SemVer format + * + * Examples: + * + * GIVEN (GitHub workflow environment): + * GITHUB_RUN_NUMBER: 30 + * major: 2 + * minor: 1 + * patch: 1 + * sdkVersion: IC-2022.2 + * + * RETURNS: + * 2.1.1+30-IC-2022.2 + * + * + * GIVEN (local dev environment): + * GITHUB_RUN_NUMBER: null + * major: 2 + * minor: 2 + * patch: 34 + * sdkVersion: IC-2022.3 + * + * RETURNS: + * 2.2.34+0-IC-2022.3+alpha */ fun pluginVersion(major: String, minor: String, patch: String) = listOf( major, minor, - patch, - maybeGithubRunNumber?.let { "$it-${descriptor.sdkVersion}" } ?: "0-${descriptor.sdkVersion}+alpha" + maybeGithubRunNumber?.let { "$patch+$it-${descriptor.sdkVersion}" } ?: "$patch+0-${descriptor.sdkVersion}+alpha" ).joinToString(".") From 0429da2b456fb9a14867785a35c0ac4e15c25762 Mon Sep 17 00:00:00 2001 From: londonbrown Date: Mon, 5 Dec 2022 09:16:07 -0800 Subject: [PATCH 2/2] Bump minor version --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index f2c340f..9806ec5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -77,7 +77,7 @@ val pluginGroup: String by project // `pluginName_` variable ends with `_` because of the collision with Kotlin magic getter in the `intellij` closure. // Read more about the issue: https://github.com/JetBrains/intellij-platform-plugin-template/issues/29 val pluginName_: String by project -val pluginVersion: String = pluginVersion(major = "2", minor = "1", patch = "1") +val pluginVersion: String = pluginVersion(major = "2", minor = "2", patch = "0") val pluginDescriptionFile: String by project val pluginChangeNotesFile: String by project