From 9070e11035b05d787907ed93a52e8aff578127b1 Mon Sep 17 00:00:00 2001 From: mustard Date: Thu, 12 Sep 2024 14:28:57 +0800 Subject: [PATCH] [JetBrains] Update Platform Version from JetBrains Gateway Plugin (Stable) (#20201) * Update Platform Version of JetBrains Gateway Plugin (Stable) to * Fix and update GHA script * fixup --------- Co-authored-by: Robo Quat --- .../ide/gha-update-image/index-jb-platform-update.ts | 2 ++ .../gha-update-image/lib/jb-update-platform-version.ts | 7 +++++-- components/ide/jetbrains/gateway-plugin/build.gradle.kts | 8 ++++---- .../ide/jetbrains/gateway-plugin/gradle-stable.properties | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/components/ide/gha-update-image/index-jb-platform-update.ts b/components/ide/gha-update-image/index-jb-platform-update.ts index eeb688cc496b07..3b0a5fa0104faa 100644 --- a/components/ide/gha-update-image/index-jb-platform-update.ts +++ b/components/ide/gha-update-image/index-jb-platform-update.ts @@ -43,6 +43,7 @@ platformVersion={{platformVersion}} xmlName: "Gateway", xmlChannels: ["GW-EAP-licensing-EAP", "GW-RELEASE-licensing-RELEASE", "GW-EAP-licensing-RELEASE"], useXml: true, + useHumanreadableVersion: true, gradlePropertiesPath: path.resolve( pathToProjectRoot, "components/ide/jetbrains/gateway-plugin/gradle-latest.properties", @@ -68,6 +69,7 @@ platformVersion={{platformVersion}} xmlName: "Gateway", xmlChannels: ["GW-RELEASE-licensing-RELEASE"], useXml: true, + useHumanreadableVersion: true, gradlePropertiesPath: path.resolve( pathToProjectRoot, "components/ide/jetbrains/gateway-plugin/gradle-stable.properties", diff --git a/components/ide/gha-update-image/lib/jb-update-platform-version.ts b/components/ide/gha-update-image/lib/jb-update-platform-version.ts index bf0c5a81725a58..26f0e6707cacfe 100644 --- a/components/ide/gha-update-image/lib/jb-update-platform-version.ts +++ b/components/ide/gha-update-image/lib/jb-update-platform-version.ts @@ -12,6 +12,7 @@ interface TargetInfo { xmlName: string; xmlChannels: string[]; useXml: boolean; + useHumanreadableVersion: boolean; gradlePropertiesPath: string; gradlePropertiesTemplate: string; } @@ -41,7 +42,8 @@ const productReleaseZod = z.record( ); async function fetchLatestVersionFromProductReleases(info: TargetInfo) { - const { productCode, productType, useXml } = info; + const { productCode, productType, useXml, useHumanreadableVersion } = info; + // https://data.services.jetbrains.com/products/releases?code=GW&type=eap,rc,release&platform=linux const url = `https://data.services.jetbrains.com/products/releases?code=${productCode}&type=${productType}&platform=linux`; const response = await axios.get(url); const data = productReleaseZod.parse(response.data); @@ -55,11 +57,12 @@ async function fetchLatestVersionFromProductReleases(info: TargetInfo) { throw new Error(`Invalid build version ${build}`); } const latestPlatformVersion = !useXml ? `${buildSem.major}.${buildSem.minor}-EAP-CANDIDATE-SNAPSHOT` : build; + const latestHumanreadablePlatfromVersion = latestBuild.version; return { pluginSinceBuild: `${buildSem.major}.${buildSem.minor}`, pluginUntilBuild: `${buildSem.major}.*`, pluginVerifierIdeVersions: latestBuild.majorVersion, - platformVersion: latestPlatformVersion, + platformVersion: useHumanreadableVersion ? latestHumanreadablePlatfromVersion : latestPlatformVersion, }; } diff --git a/components/ide/jetbrains/gateway-plugin/build.gradle.kts b/components/ide/jetbrains/gateway-plugin/build.gradle.kts index 87054a8ed0f522..a6498d056107b8 100644 --- a/components/ide/jetbrains/gateway-plugin/build.gradle.kts +++ b/components/ide/jetbrains/gateway-plugin/build.gradle.kts @@ -16,8 +16,8 @@ plugins { // Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm id("org.jetbrains.kotlin.jvm") version "2.0.0" // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin - id("org.jetbrains.intellij.platform") version "2.0.0" -// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta8" + id("org.jetbrains.intellij.platform") version "2.0.1" +// id("org.jetbrains.intellij.platform.migration") version "2.0.1" // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin id("org.jetbrains.changelog") version "1.1.2" // detekt linter - read more: https://detekt.github.io/detekt/gradle.html @@ -72,9 +72,9 @@ dependencies { dependencies { intellijPlatform { + // https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#target-platforms // https://www.jetbrains.com/updates/updates.xml create(IntelliJPlatformType.Gateway, properties("platformVersion")) -// create(IntelliJPlatformType.Gateway) bundledPlugins(properties("platformBundledPlugins").split(',').map{ it.trim() }) } } @@ -106,7 +106,7 @@ intellijPlatform { } } - verifyPlugin { + pluginVerification { ides { properties("pluginVerifierIdeVersions").split(',').map(String::trim).forEach { version -> ide(IntelliJPlatformType.Gateway, version) diff --git a/components/ide/jetbrains/gateway-plugin/gradle-stable.properties b/components/ide/jetbrains/gateway-plugin/gradle-stable.properties index 0afb61e6eb9593..73916f13b4757b 100644 --- a/components/ide/jetbrains/gateway-plugin/gradle-stable.properties +++ b/components/ide/jetbrains/gateway-plugin/gradle-stable.properties @@ -7,5 +7,5 @@ pluginUntilBuild=242.* # Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl # See https://jb.gg/intellij-platform-builds-list for available build versions. pluginVerifierIdeVersions=2024.2 -# Version from "com.jetbrains.gateway" which can be found at https://www.jetbrains.com/updates/updates.xml -platformVersion=242.20224.368 +# Version from "com.jetbrains.gateway" which can be found at https://www.jetbrains.com/updates/updates.xml or exec `./gradlew printProductsReleases` +platformVersion=2024.2.1