Skip to content

Commit 5ff766f

Browse files
committed
chore: bump minimal version to 2022.3, due to IJ gradle plugin 2.x used.
see https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#requirements fixes #287 Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
1 parent 2f77bc1 commit 5ff766f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ repositories {
1818

1919
dependencies {
2020
implementation(libs.kotlin.reflect)
21-
implementation(libs.openapi)
2221
api(libs.junit.jupiter.api)
2322
api(libs.remote.robot)
2423
api(libs.remote.fixtures)

gradle/libs.versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
remote-robot = "0.11.23"
44
kotlin = "2.1.0"
55
junit-jupiter = "5.12.2"
6-
openapi = "7.0.3"
76

87
# plugins
98
sonarqube = "5.1.0.4882"
@@ -13,7 +12,6 @@ kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", vers
1312
junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
1413
remote-robot = { group = "com.intellij.remoterobot", name = "remote-robot", version.ref = "remote-robot" }
1514
remote-fixtures = { group = "com.intellij.remoterobot", name = "remote-fixtures", version.ref = "remote-robot" }
16-
openapi = { group = "com.intellij", name = "openapi", version.ref = "openapi" }
1715

1816
[plugins]
1917
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }

src/main/java/com/redhat/devtools/intellij/commonuitest/UITestRunner.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
******************************************************************************/
1111
package com.redhat.devtools.intellij.commonuitest;
1212

13-
import com.intellij.openapi.util.SystemInfo;
1413
import com.intellij.remoterobot.RemoteRobot;
1514
import com.intellij.remoterobot.stepsProcessing.StepLogger;
1615
import com.intellij.remoterobot.stepsProcessing.StepWorker;
@@ -48,6 +47,7 @@ public class UITestRunner {
4847
private static final String ACCEPTED_SOURCE_LOCATION = "accepted";
4948
private static final String COPY_ACCEPTED_FILE_STEP_DESCRIPTION = "Copy the 'accepted' file to the appropriate location";
5049
private static final Logger LOGGER = Logger.getLogger(UITestRunner.class.getName());
50+
private static final String OS_NAME = System.getProperty("os.name").toLowerCase();
5151
private static final String USER_HOME = System.getProperty("user.home");
5252
private static final String NEW_ITEM_PROPERTY = "New-ItemProperty";
5353
private static final String NAME_PARAM = "-Name";
@@ -69,15 +69,15 @@ public static RemoteRobot runIde(IntelliJVersion ideaVersionUnderTest, int port)
6969
StepWorker.registerProcessor(new StepLogger());
7070
ideaVersion = ideaVersionUnderTest;
7171
if (ideaVersionUnderTest.equals(IntelliJVersion.UNSUPPORTED)) {
72-
LOGGER.severe("Cannot run Idea. Version is unsupported");
72+
LOGGER.severe("Cannot run Idea, version is unsupported. Please check supported versions in the documentation.");
7373
return null;
7474
}
7575

7676
return step("Start IntelliJ Idea ('" + ideaVersion + "') listening on port " + port, () -> {
7777

7878
acceptAllTermsAndConditions();
7979

80-
String fileExtension = SystemInfo.isWindows ? ".bat" : "";
80+
String fileExtension = OS_NAME.contains("windows") ? ".bat" : "";
8181
String platformVersion = generatePlatformVersion();
8282

8383
ProcessBuilder pb = new ProcessBuilder("." + File.separator + "gradlew" + fileExtension, "runIdeForUiTests", "-PideaVersion=" + platformVersion, "-Drobot-server.port=" + port);
@@ -162,7 +162,7 @@ private static void acceptAllTermsAndConditions() {
162162
linuxPrefsXmlSourceLocation = "prefs_xml/2022_1/prefs.xml";
163163
}
164164

165-
if (SystemInfo.isLinux) {
165+
if (OS_NAME.contains("linux")) {
166166
step("Copy the 'prefs.xml' file to the appropriate location", () -> {
167167
String prefsXmlDir = USER_HOME + "/.java/.userPrefs/jetbrains/_!(!!cg\"p!(}!}@\"j!(k!|w\"w!'8!b!\"p!':!e@==";
168168
createDirectoryHierarchy(prefsXmlDir);
@@ -174,7 +174,7 @@ private static void acceptAllTermsAndConditions() {
174174
createDirectoryHierarchy(acceptedDir);
175175
copyFileFromJarResourceDir(ACCEPTED_SOURCE_LOCATION, acceptedDir + "/accepted");
176176
});
177-
} else if (SystemInfo.isMac) {
177+
} else if (OS_NAME.contains("os x")) {
178178
step("Copy the 'com.apple.java.util.prefs.plist' file to the appropriate location", () -> {
179179
String plistDir = USER_HOME + "/Library/Preferences";
180180
copyFileFromJarResourceDir(osxPlistSourceLocation, plistDir + "/com.apple.java.util.prefs.plist");
@@ -195,7 +195,7 @@ private static void acceptAllTermsAndConditions() {
195195
Thread.currentThread().interrupt();
196196
}
197197
});
198-
} else if (SystemInfo.isWindows) {
198+
} else if (OS_NAME.contains("windows")) {
199199
step(COPY_ACCEPTED_FILE_STEP_DESCRIPTION, () -> {
200200
String acceptedDir = USER_HOME + "\\AppData\\Roaming\\JetBrains\\consentOptions";
201201
createDirectoryHierarchy(acceptedDir);

0 commit comments

Comments
 (0)