Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLCORE-1105 Avoid displaying the Java icon in the taskbar on MacOS #1209

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ private static List<String> createCommand(Path distPath, Path jreJavaExePath, @N
if (clientJvmOpts != null) {
commands.addAll(Arrays.asList(clientJvmOpts.split(" ")));
}
// Avoid displaying the Java icon in the taskbar on Mac
commands.add("-Djava.awt.headless=true");
commands.add("-classpath");
commands.add(classpath);
commands.add(SLOOP_CLI_ENTRYPOINT_CLASS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ void test_command_with_embedded_jre(@TempDir Path distPath) throws IOException {

sloop = underTest.start(distPath);

verify(mockPbFactory).apply(List.of(bundledJrejavaPath.toString(), "-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
verify(mockPbFactory).apply(List.of(bundledJrejavaPath.toString(), "-Djava.awt.headless=true",
"-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
assertThat(sloop.getRpcServer()).isNotNull();
}

Expand All @@ -100,7 +101,8 @@ void test_command_with_custom_jre_on_linux(@TempDir Path distPath) {
sloop = underTest.start(distPath, fakeJreHomePath);

verify(mockPbFactory)
.apply(List.of(fakeJreJavaLinuxPath.toString(), "-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
.apply(List.of(fakeJreJavaLinuxPath.toString(), "-Djava.awt.headless=true",
"-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
assertThat(sloop.getRpcServer()).isNotNull();
}

Expand All @@ -110,7 +112,8 @@ void test_command_with_custom_jre_on_windows(@TempDir Path distPath) {
sloop = underTest.start(distPath, fakeJreHomePath);

verify(mockPbFactory)
.apply(List.of(fakeJreJavaWindowsPath.toString(), "-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
.apply(List.of(fakeJreJavaWindowsPath.toString(), "-Djava.awt.headless=true",
"-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
assertThat(sloop.getRpcServer()).isNotNull();
}

Expand Down Expand Up @@ -155,7 +158,8 @@ void test_command_with_custom_jre_on_linux_and_jvm_option(@TempDir Path distPath
sloop = underTest.start(distPath, fakeJreHomePath, "-XX:+UseG1GC -XX:MaxHeapFreeRatio=50");

verify(mockPbFactory)
.apply(List.of(fakeJreJavaLinuxPath.toString(), "-XX:+UseG1GC", "-XX:MaxHeapFreeRatio=50", "-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
.apply(List.of(fakeJreJavaLinuxPath.toString(), "-XX:+UseG1GC", "-XX:MaxHeapFreeRatio=50", "-Djava.awt.headless=true",
"-classpath", distPath.resolve("lib") + File.separator + '*', "org.sonarsource.sonarlint.core.backend.cli.SonarLintServerCli"));
assertThat(sloop.getRpcServer()).isNotNull();
}
}
Loading