Skip to content

Commit 3f63730

Browse files
authored
[JetBrains] Migrate backend-plugin platform version for 2024.2 (#19978)
* [JetBrains] Migrate platform version for `2024.2.*` - Update Platform Version of JetBrains Backend Plugin (EAP) to 242.18071-EAP-CANDIDATE-SNAPSHOT * fix sdkman cmd not found * Regist plugin verify task * stable broken * restart to get more workspace space * Make it build * Remove deprecated preload property * Revert "Remove deprecated preload property" This reverts commit 4574632. * do not verify * add todo * Use `--build-file` flag * Revert "Use `--build-file` flag" This reverts commit 3cc4494.
1 parent 23dfac6 commit 3f63730

File tree

11 files changed

+405
-47
lines changed

11 files changed

+405
-47
lines changed

.idea/misc.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/ide/jetbrains/backend-plugin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
bin
55
build
66
gradle-local.properties
7+
.intellijPlatform

components/ide/jetbrains/backend-plugin/BUILD.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ packages:
4141
- components/gitpod-protocol/java:lib
4242
srcs:
4343
- "**/*.kt"
44-
- "build.gradle.kts"
44+
- "build.gradle-stable.kts"
4545
- "gradle.properties"
4646
- "gradle-stable.properties"
4747
- "gradle/wrapper/*"
@@ -55,6 +55,7 @@ packages:
5555
- NO_VERIFY_JB_PLUGIN=${noVerifyJBPlugin}
5656
config:
5757
commands:
58+
- ["mv", "build.gradle-stable.kts", "build.gradle.kts"]
5859
- ["./build.sh", "${__git_commit}"]
5960
- name: plugin-latest
6061
type: generic
@@ -65,7 +66,7 @@ packages:
6566
- components/gitpod-protocol/java:lib
6667
srcs:
6768
- "**/*.kt"
68-
- "build.gradle.kts"
69+
- "build.gradle-latest.kts"
6970
- "gradle.properties"
7071
- "gradle-latest.properties"
7172
- "gradle/wrapper/*"
@@ -77,9 +78,19 @@ packages:
7778
env:
7879
- JB_QUALIFIER=latest
7980
- NO_VERIFY_JB_PLUGIN=${noVerifyJBPlugin}
81+
# TODO(hw): remove after `2024.2.*` is stable
82+
- SDKMAN_DIR=/home/gitpod/.sdkman
8083
config:
8184
commands:
82-
- ["./build.sh", "${__git_commit}"]
85+
# TODO(hw): remove after 2024.2.* is stable
86+
- ["mv", "build.gradle-latest.kts", "build.gradle.kts"]
87+
- - "bash"
88+
- "-c"
89+
- >
90+
echo java=21.0.3.fx-zulu > .sdkmanrc
91+
&& source "$SDKMAN_DIR/bin/sdkman-init.sh"
92+
&& sdk env install
93+
&& ./build.sh ${__git_commit}
8394
- name: latest-info
8495
type: generic
8596
srcs:

components/ide/jetbrains/backend-plugin/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Provides integrations within a Gitpod workspace.
55

66
<!-- Plugin description end -->
77

8+
## Development before `2024.2.*` is released
9+
10+
- You will need to copy content in build.gradle-stable.kts if you want to test stable IDEs changes. For latest, this step is the same
11+
- Make sure your build script `build.gradle.kts` is synced with `build.gradle-<version>.kts`
12+
- Other steps are the same with *Development* section
13+
814
## Development
915

1016
The ideal setup to develop this plugin is using IntelliJ in Gitpod.
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// Copyright (c) 2024 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License.AGPL.txt in the project root for license information.
4+
5+
import io.gitlab.arturbosch.detekt.Detekt
6+
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
7+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
8+
9+
fun properties(key: String) = project.findProperty(key).toString()
10+
11+
plugins {
12+
// Java support
13+
id("java")
14+
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
15+
id("org.jetbrains.kotlin.jvm") version "2.0.0"
16+
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
17+
id("org.jetbrains.intellij.platform") version "2.0.0-beta8"
18+
// id("org.jetbrains.intellij.platform.migration") version "2.0.0-beta7"
19+
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
20+
id("io.gitlab.arturbosch.detekt") version "1.23.6"
21+
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
22+
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
23+
// Gradle Properties Plugin - read more: https://github.com/stevesaliman/gradle-properties-plugin
24+
id("net.saliman.properties") version "1.5.2"
25+
}
26+
27+
group = properties("pluginGroup")
28+
val environmentName = properties("environmentName")
29+
var pluginVersion = "${properties("pluginVersion")}-${properties("gitpodVersion")}"
30+
31+
if (environmentName.isNotBlank()) {
32+
pluginVersion += "-$environmentName"
33+
}
34+
35+
project(":") {
36+
kotlin {
37+
val excludedPackage = if (environmentName == "latest") "stable" else "latest"
38+
sourceSets["main"].kotlin.exclude("io/gitpod/jetbrains/remote/${excludedPackage}/**")
39+
}
40+
41+
sourceSets {
42+
main {
43+
resources.srcDirs("src/main/resources-${environmentName}")
44+
}
45+
}
46+
}
47+
48+
// Configure project's dependencies
49+
repositories {
50+
mavenCentral()
51+
}
52+
53+
dependencies {
54+
implementation(project(":supervisor-api")) {
55+
artifact {
56+
type = "jar"
57+
}
58+
}
59+
implementation(project(":gitpod-protocol")) {
60+
artifact {
61+
type = "jar"
62+
}
63+
}
64+
implementation("io.prometheus:simpleclient_pushgateway:0.15.0")
65+
compileOnly("javax.websocket:javax.websocket-api:1.1")
66+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
67+
testImplementation(kotlin("test"))
68+
69+
// grpc
70+
// https://mvnrepository.com/artifact/com.google.api.grpc/proto-google-common-protos
71+
implementation("com.google.api.grpc:proto-google-common-protos:2.41.0")
72+
implementation("io.grpc:grpc-core:1.65.0")
73+
implementation("io.grpc:grpc-protobuf:1.65.0")
74+
// https://mvnrepository.com/artifact/io.grpc/grpc-stub
75+
implementation("io.grpc:grpc-stub:1.65.0")
76+
implementation("io.grpc:grpc-netty-shaded:1.65.0")
77+
}
78+
79+
repositories {
80+
mavenCentral()
81+
intellijPlatform {
82+
defaultRepositories()
83+
}
84+
}
85+
86+
dependencies {
87+
intellijPlatform {
88+
create(properties("platformType"), properties("platformVersion"))
89+
90+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
91+
bundledPlugins(properties("platformBundledPlugins").split(',').map{ it.trim() })
92+
}
93+
}
94+
95+
// Configure gradle-intellij-plugin plugin.
96+
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
97+
intellijPlatform {
98+
pluginConfiguration {
99+
name = properties("pluginName")
100+
version = pluginVersion
101+
ideaVersion {
102+
sinceBuild = properties("pluginSinceBuild")
103+
untilBuild = properties("pluginUntilBuild")
104+
}
105+
}
106+
instrumentCode = false
107+
108+
}
109+
110+
// Configure detekt plugin.
111+
// Read more: https://detekt.github.io/detekt/kotlindsl.html
112+
detekt {
113+
autoCorrect = true
114+
buildUponDefaultConfig = true
115+
ignoreFailures = true
116+
117+
// reports {
118+
// html.enabled = false
119+
// xml.enabled = false
120+
// txt.enabled = false
121+
// }
122+
}
123+
124+
ktlint {
125+
ignoreFailures = true
126+
filter {
127+
exclude("build.gradle-*.kts")
128+
}
129+
}
130+
131+
kotlin {
132+
jvmToolchain(21)
133+
}
134+
135+
tasks.withType<Detekt> {
136+
jvmTarget = "21"
137+
onlyIf { project.findProperty("skipDetekt") != "true" }
138+
}
139+
140+
tasks {
141+
withType<JavaCompile> {
142+
sourceCompatibility = "21"
143+
targetCompatibility = "21"
144+
}
145+
withType<KotlinCompile> {
146+
kotlinOptions.jvmTarget = "21"
147+
}
148+
149+
buildSearchableOptions {
150+
enabled = false
151+
}
152+
153+
test {
154+
// Currently, we need to indicate where are the test classes.
155+
// Read more: https://youtrack.jetbrains.com/issue/IDEA-278926/All-inheritors-of-UsefulTestCase-are-invisible-for-Gradle#focus=Comments-27-5561012.0-0
156+
isScanForTestClasses = false
157+
include("**/*Test.class")
158+
}
159+
}
160+
161+
tasks.register("runPluginVerifier") {
162+
intellijPlatform.verifyPlugin.ides.ide(IntelliJPlatformType.IntellijIdeaUltimate, properties("pluginVerifierIdeVersions"))
163+
}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License.AGPL.txt in the project root for license information.
4+
5+
import io.gitlab.arturbosch.detekt.Detekt
6+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
7+
8+
fun properties(key: String) = project.findProperty(key).toString()
9+
10+
plugins {
11+
// Java support
12+
id("java")
13+
// Kotlin support - check the latest version at https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
14+
id("org.jetbrains.kotlin.jvm") version "1.9.0"
15+
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
16+
id("org.jetbrains.intellij") version "1.17.4"
17+
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
18+
id("io.gitlab.arturbosch.detekt") version "1.21.0"
19+
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
20+
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
21+
// Gradle Properties Plugin - read more: https://github.com/stevesaliman/gradle-properties-plugin
22+
id("net.saliman.properties") version "1.5.2"
23+
}
24+
25+
group = properties("pluginGroup")
26+
val environmentName = properties("environmentName")
27+
var pluginVersion = "${properties("pluginVersion")}-${properties("gitpodVersion")}"
28+
29+
if (environmentName.isNotBlank()) {
30+
pluginVersion += "-$environmentName"
31+
}
32+
33+
project(":") {
34+
kotlin {
35+
val excludedPackage = if (environmentName == "latest") "stable" else "latest"
36+
sourceSets["main"].kotlin.exclude("io/gitpod/jetbrains/remote/${excludedPackage}/**")
37+
}
38+
39+
sourceSets {
40+
main {
41+
resources.srcDirs("src/main/resources-${environmentName}")
42+
}
43+
}
44+
}
45+
46+
// Configure project's dependencies
47+
repositories {
48+
mavenCentral()
49+
}
50+
51+
dependencies {
52+
implementation(project(":supervisor-api")) {
53+
artifact {
54+
type = "jar"
55+
}
56+
}
57+
implementation(project(":gitpod-protocol")) {
58+
artifact {
59+
type = "jar"
60+
}
61+
}
62+
implementation("io.prometheus:simpleclient_pushgateway:0.15.0")
63+
compileOnly("javax.websocket:javax.websocket-api:1.1")
64+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.1")
65+
testImplementation(kotlin("test"))
66+
67+
// grpc
68+
implementation("com.google.api.grpc:proto-google-common-protos:2.2.2")
69+
implementation("io.grpc:grpc-core:1.49.0")
70+
implementation("io.grpc:grpc-protobuf:1.49.0")
71+
implementation("io.grpc:grpc-stub:1.49.0")
72+
implementation("io.grpc:grpc-netty-shaded:1.49.0")
73+
}
74+
75+
// Configure gradle-intellij-plugin plugin.
76+
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
77+
intellij {
78+
pluginName.set(properties("pluginName"))
79+
version.set(properties("platformVersion"))
80+
type.set(properties("platformType"))
81+
instrumentCode.set(false)
82+
downloadSources.set(properties("platformDownloadSources").toBoolean())
83+
updateSinceUntilBuild.set(true)
84+
85+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file.
86+
plugins.set(properties("platformBundledPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
87+
}
88+
89+
// Configure detekt plugin.
90+
// Read more: https://detekt.github.io/detekt/kotlindsl.html
91+
detekt {
92+
autoCorrect = true
93+
buildUponDefaultConfig = true
94+
ignoreFailures = true
95+
96+
reports {
97+
html.enabled = false
98+
xml.enabled = false
99+
txt.enabled = false
100+
}
101+
}
102+
ktlint {
103+
ignoreFailures = true
104+
}
105+
106+
tasks {
107+
withType<JavaCompile> {
108+
sourceCompatibility = "17"
109+
targetCompatibility = "17"
110+
}
111+
withType<KotlinCompile> {
112+
kotlinOptions.jvmTarget = "17"
113+
}
114+
115+
withType<Detekt> {
116+
jvmTarget = "17"
117+
}
118+
119+
buildSearchableOptions {
120+
enabled = false
121+
}
122+
123+
test {
124+
// Currently, we need to indicate where are the test classes.
125+
// Read more: https://youtrack.jetbrains.com/issue/IDEA-278926/All-inheritors-of-UsefulTestCase-are-invisible-for-Gradle#focus=Comments-27-5561012.0-0
126+
isScanForTestClasses = false
127+
include("**/*Test.class")
128+
}
129+
130+
runPluginVerifier {
131+
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
132+
}
133+
134+
patchPluginXml {
135+
version.set(pluginVersion)
136+
}
137+
138+
verifyPlugin {
139+
// TODO(hw): DO NOT IGNORE FAILURE AFTER UPGRADE
140+
ignoreFailures = true
141+
}
142+
}

0 commit comments

Comments
 (0)