Skip to content

Commit 83a19ef

Browse files
committed
chore: migrate build to 2024.2
Signed-off-by: Stephane Bouchet <[email protected]>
1 parent 43b450d commit 83a19ef

32 files changed

+355
-269
lines changed

.github/workflows/IJ-latest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
- name: Grant execute permission for gradlew
2424
run: chmod +x gradlew
2525
- name: Build with Gradle
26-
run: ./gradlew build --continue -PideaVersion=LATEST-EAP-SNAPSHOT
26+
run: |
27+
LATEST-EAP-SNAPSHOT=$(./gradlew printProductsReleases | grep 'IC-' | head -n 1 | cut -d'-' -f2)
28+
./gradlew build --continue -PplatformVersion=$LATEST-EAP-SNAPSHOT
2729
- uses: actions/upload-artifact@v4
2830
if: always()
2931
with:

.github/workflows/IJ.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
IJ: [IC-2022.3, IC-2023.1, IC-2023.2, IC-2023.3, IC-2024.1]
17+
IJ: [2022.3, 2023.1, 2023.2, 2023.3, 2024.1, 2024.2]
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -27,7 +27,7 @@ jobs:
2727
- name: Grant execute permission for gradlew
2828
run: chmod +x gradlew
2929
- name: Build with Gradle
30-
run: ./gradlew build -PideaVersion=${{ matrix.IJ }}
30+
run: ./gradlew build -PplatformVersion=${{ matrix.IJ }}
3131

3232
verify:
3333
runs-on: ubuntu-latest
@@ -44,7 +44,7 @@ jobs:
4444
- name: Grant execute permission for gradlew
4545
run: chmod +x gradlew
4646
- name: Build with Gradle
47-
run: ./gradlew runPluginVerifier -PideaVersion=IC-2023.2
47+
run: ./gradlew verifyPlugin -PplatformVersion=${{ matrix.IJ }}
4848
- name: Upload report
4949
uses: actions/upload-artifact@v4
5050
if: always()

.github/workflows/accepted

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/it.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ jobs:
3434
make run-local
3535
- name: Run integration tests
3636
run: |
37-
dir=~/.java/.userPrefs/jetbrains/_\!\(\!\!cg\"p\!\(\}\!\}@\"j\!\(k\!\|w\"w\!\'8\!b\!\"p\!\':\!e@=\=
38-
mkdir -p "$dir"
39-
cp .github/workflows/prefs.xml $dir
40-
mkdir -p ~/.local/share/JetBrains/consentOptions
41-
cp .github/workflows/accepted ~/.local/share/JetBrains/consentOptions
4237
export DISPLAY=:99.0
4338
Xvfb -ac :99 -screen 0 1920x1080x16 &
39+
sleep 10
4440
./gradlew integrationTest --info
4541
- uses: actions/upload-artifact@v4
4642
with:

.github/workflows/prefs.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
current-tag: ${{ inputs.release_version }}
112112
types-mapping: 'feat:Features,fix:Bug Fixes,docs:Documentation,refactor:Refactoring,build:Builds,chore:Other'
113113

114-
# Create a new Github release
114+
# Create a new GitHub release
115115
- name: Create Github Release
116116
env:
117117
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -128,4 +128,3 @@ jobs:
128128
env:
129129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130130
run: gh release upload ${{ inputs.release_version }} ./build/distributions/*
131-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build
55
.gradle
66
out
77

8+
/.intellijPlatform/

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
###########################################
2-
# Intellij-kubernets run build minikube #
3-
###########################################
1+
############################################
2+
# Intellij-kubernetes run build minikube #
3+
############################################
44

55
MOD_FLAGS := $(shell (go version | grep -q -E "1\.1[1-9]") && echo -mod=vendor)
66
CMDS := $(shell go list $(MOD_FLAGS) ./cmd/...)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ UI Testing
157157
==========
158158
You can perform UI testing by running the following command:
159159
```sh
160-
./gradlew clean runIdeForUiTests -PideaVersion=IC-2020.2 & ./gradlew integrationTest
160+
./gradlew integrationTest
161161
```
162162

163163
License

build.gradle.kts

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
2+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
3+
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
4+
5+
plugins {
6+
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
7+
alias(libs.plugins.kotlinJvm)
8+
id("idea")
9+
}
10+
11+
group = "com.redhat.devtools.intellij"
12+
version = providers.gradleProperty("projectVersion").get() // Plugin version
13+
val ideaVersion = providers.gradleProperty("platformVersion").get()
14+
val javaVersion = 17
15+
16+
// Set the JVM language level used to build the project.
17+
kotlin {
18+
jvmToolchain(javaVersion)
19+
}
20+
21+
java {
22+
toolchain {
23+
languageVersion = JavaLanguageVersion.of(javaVersion)
24+
}
25+
sourceCompatibility = JavaVersion.toVersion(javaVersion)
26+
targetCompatibility = JavaVersion.toVersion(javaVersion)
27+
}
28+
29+
30+
repositories {
31+
mavenLocal()
32+
maven { url = uri("https://repository.jboss.org") }
33+
mavenCentral()
34+
intellijPlatform {
35+
defaultRepositories()
36+
}
37+
}
38+
39+
dependencies {
40+
intellijPlatform {
41+
create(IntelliJPlatformType.IntellijIdeaCommunity, ideaVersion)
42+
43+
// Bundled Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
44+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
45+
46+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
47+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
48+
49+
// for local plugin -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin-faq.html#how-to-add-a-dependency-on-a-plugin-available-in-the-file-system
50+
//plugins.set(listOf(file("/path/to/plugin/")))
51+
52+
pluginVerifier()
53+
54+
instrumentationTools()
55+
56+
testFramework(TestFrameworkType.Platform)
57+
}
58+
59+
implementation(libs.devtools.common)
60+
implementation(libs.kubernetes.client)
61+
implementation(libs.kubernetes.model)
62+
implementation(libs.kubernetes.model.common)
63+
implementation(libs.openshift.client)
64+
implementation(libs.kubernetes.httpclient.okhttp)
65+
implementation(libs.jackson.core)
66+
implementation(libs.commons.lang3)
67+
68+
// for unit tests
69+
testImplementation(libs.assertj.core)
70+
testImplementation(libs.mockito.inline)
71+
testImplementation(libs.mockito.kotlin)
72+
testImplementation(libs.kotlin.test.junit)
73+
74+
}
75+
76+
intellijPlatform {
77+
buildSearchableOptions = false
78+
79+
pluginConfiguration {
80+
ideaVersion {
81+
sinceBuild = providers.gradleProperty("pluginSinceBuild")
82+
untilBuild = provider { null }
83+
}
84+
}
85+
86+
publishing {
87+
token = providers.gradleProperty("jetBrainsToken")
88+
channels = providers.gradleProperty("jetBrainsChannel").map { listOf(it) }
89+
}
90+
91+
pluginVerification {
92+
ides {
93+
ide(IntelliJPlatformType.IntellijIdeaUltimate, ideaVersion)
94+
}
95+
freeArgs = listOf(
96+
"-mute",
97+
"TemplateWordInPluginId,TemplateWordInPluginName"
98+
)
99+
}
100+
}
101+
102+
tasks {
103+
wrapper {
104+
gradleVersion = providers.gradleProperty("gradleVersion").get()
105+
}
106+
107+
runIde {
108+
systemProperty("com.redhat.devtools.intellij.telemetry.mode", "debug")
109+
}
110+
111+
test {
112+
systemProperty("com.redhat.devtools.intellij.telemetry.mode", "disabled")
113+
/*afterSuite(KotlinClosure2({ desc: TestDescriptor, result: TestResult ->
114+
if (desc.parent != null)
115+
println("${result.resultType} " +
116+
"(${result.testCount} tests, " +
117+
"${result.successfulTestCount} successes, " +
118+
"${result.failedTestCount} failures, " +
119+
"${result.skippedTestCount} skipped)")
120+
}))*/
121+
}
122+
123+
printProductsReleases {
124+
channels = listOf(ProductRelease.Channel.EAP)
125+
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
126+
untilBuild = provider { null }
127+
}
128+
}
129+
130+
configurations.all {
131+
exclude(group = "org.slf4j", module = "slf4j-api")
132+
}
133+
134+
sourceSets {
135+
create("it") {
136+
description = "integrationTest"
137+
compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.test.get().compileClasspath
138+
runtimeClasspath += output + compileClasspath
139+
}
140+
}
141+
142+
configurations["itRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get())
143+
configurations["itImplementation"].extendsFrom(configurations.testImplementation.get())
144+
145+
val integrationTest by intellijPlatformTesting.testIde.registering {
146+
task {
147+
useJUnitPlatform()
148+
systemProperty("com.redhat.devtools.intellij.telemetry.mode", "disabled")
149+
description = "Runs the integration tests."
150+
group = "verification"
151+
testClassesDirs = sourceSets["it"].output.classesDirs
152+
classpath = sourceSets["it"].runtimeClasspath
153+
jvmArgs("-Djava.awt.headless=true")
154+
shouldRunAfter(tasks["test"])
155+
}
156+
157+
plugins {
158+
robotServerPlugin()
159+
}
160+
161+
dependencies {
162+
testImplementation(libs.devtools.common)
163+
testImplementation(libs.devtools.common.ui.test)
164+
testImplementation(libs.junit.platform.launcher)
165+
testImplementation(libs.junit.platform.suite)
166+
testImplementation(libs.junit.jupiter)
167+
testImplementation(libs.junit.jupiter.api)
168+
testImplementation(libs.junit.jupiter.engine)
169+
testImplementation(libs.gson)
170+
}
171+
}
172+
173+
174+
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#runIdeForUiTests
175+
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
176+
task {
177+
jvmArgumentProviders += CommandLineArgumentProvider {
178+
listOf(
179+
"-Dide.mac.message.dialogs.as.sheets=false",
180+
"-Djb.privacy.policy.text=<!--999.999-->",
181+
"-Djb.consents.confirmation.enabled=false",
182+
"-Duser.language=en -Duser.country=US"
183+
)
184+
}
185+
186+
systemProperty("robot-server.port", System.getProperty("robot-server.port"))
187+
systemProperties["com.redhat.devtools.intellij.telemetry.mode"] = "disabled"
188+
}
189+
190+
plugins {
191+
robotServerPlugin()
192+
}
193+
}
194+
195+
// below is only to correctly configure IDEA project settings
196+
idea {
197+
module {
198+
testSources.from(sourceSets["it"].java.srcDirs)
199+
}
200+
}

build.gradle renamed to build.gradle_old

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.ideaVersion = ideaVersion
3-
ext.kotlinVersion = kotlinVersion
2+
ext.ideaVersion = "IC-2023.1"
3+
ext.kotlinVersion = "1.9.25"
44
ext.java_version = "17"
55
}
66

77
plugins {
8-
id "org.jetbrains.intellij" version "${intellijPluginVersion}"
9-
id "org.jetbrains.kotlin.jvm" version "${kotlinJvmPluginVersion}"
8+
id "org.jetbrains.intellij" version "1.16.1"
9+
id "org.jetbrains.kotlin.jvm" version "1.8.0"
1010
id "idea"
1111
}
1212

@@ -35,12 +35,12 @@ tasks.withType(Test) {
3535

3636
dependencies {
3737
implementation(
38-
"com.redhat.devtools.intellij:intellij-common:${intellijCommonVersion}",
39-
"io.fabric8:kubernetes-client:${kubernetesClientVersion}",
40-
"io.fabric8:kubernetes-model:${kubernetesClientVersion}",
41-
"io.fabric8:kubernetes-model-common:${kubernetesClientVersion}",
42-
"io.fabric8:openshift-client:${kubernetesClientVersion}",
43-
"io.fabric8:kubernetes-httpclient-okhttp:${kubernetesClientVersion}",
38+
"com.redhat.devtools.intellij:intellij-common:1.9.6",
39+
"io.fabric8:kubernetes-client:6.12.0",
40+
"io.fabric8:kubernetes-model:6.12.0",
41+
"io.fabric8:kubernetes-model-common:6.12.0",
42+
"io.fabric8:openshift-client:6.12.0",
43+
"io.fabric8:kubernetes-httpclient-okhttp:6.12.0",
4444
"com.fasterxml.jackson.core:jackson-core:2.17.0", /* IC-2022.3 ships 2.16.0 */
4545
"org.apache.commons:commons-lang3:3.12.0"
4646
)
@@ -51,7 +51,7 @@ dependencies {
5151
"org.jetbrains.kotlin:kotlin-test-junit:${kotlinVersion}"
5252
)
5353
integrationTestImplementation(
54-
"com.redhat.devtools.intellij:intellij-common:${intellijCommonVersion}",
54+
"com.redhat.devtools.intellij:intellij-common:1.9.6",
5555
"com.redhat.devtools.intellij:intellij-common-ui-test-library:0.3.0",
5656
"org.junit.jupiter:junit-jupiter-engine:5.8.2",
5757
"org.junit.jupiter:junit-jupiter-api:5.8.2",
@@ -97,27 +97,9 @@ test {
9797
intellij {
9898
version = ideaVersion //for a full list of Jetbrains IDEA releases please see https://www.jetbrains.com/intellij-repository/releases
9999
pluginName = "Kubernetes by Red Hat"
100-
plugins = ["yaml", "com.redhat.devtools.intellij.telemetry:${telemetryPluginVersion}" ]
101100
updateSinceUntilBuild = false
102101
}
103102

104-
runIde {
105-
systemProperties["com.redhat.devtools.intellij.telemetry.mode"] = "debug"
106-
}
107-
108-
patchPluginXml {
109-
sinceBuild = "${sinceIdeaBuild}"
110-
}
111-
112-
runPluginVerifier {
113-
ideVersions = [ideaVersion]
114-
}
115-
116-
publishPlugin {
117-
token = jetBrainsToken
118-
channels = [jetBrainsChannel]
119-
}
120-
121103
runIdeForUiTests {
122104
systemProperty "robot-server.port", System.getProperty("robot-server.port")
123105
systemProperties["com.redhat.devtools.intellij.telemetry.mode"] = "disabled"
@@ -197,16 +179,3 @@ private def colorize(String color, String message) {
197179
return new String((char) 27) + "[${colors[color]}m${message}" + new String((char) 27) + "[0m"
198180
}
199181

200-
repositories {
201-
mavenLocal()
202-
mavenCentral()
203-
maven {
204-
url "https://repository.jboss.org"
205-
}
206-
maven {
207-
url "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies"
208-
}
209-
}
210-
211-
group "com.redhat.devtools.intellij"
212-
version projectVersion

0 commit comments

Comments
 (0)