Skip to content

Commit d17c150

Browse files
authored
Merge pull request #538 from awisniew90/launch-process
Remove terminal service and create launch process
2 parents 7c8df29 + e1faaf8 commit d17c150

23 files changed

+444
-1571
lines changed

bundles/io.openliberty.tools.eclipse.ui/META-INF/MANIFEST.MF

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,7 @@ Import-Package: org.eclipse.cdt.launch.ui,
4848
org.eclipse.osgi.service.debug,
4949
org.eclipse.osgi.util,
5050
org.eclipse.swt.custom,
51-
org.eclipse.tm.internal.terminal.provisional.api,
52-
org.eclipse.tm.terminal.connector.local.launcher,
53-
org.eclipse.tm.terminal.view.core,
54-
org.eclipse.tm.terminal.view.core.interfaces,
55-
org.eclipse.tm.terminal.view.core.interfaces.constants,
56-
org.eclipse.tm.terminal.view.ui.interfaces,
57-
org.eclipse.tm.terminal.view.ui.launcher,
58-
org.eclipse.tm.terminal.view.ui.manager,
59-
org.eclipse.tm.terminal.view.ui.tabs,
51+
org.eclipse.ui.console,
6052
org.gradle.tooling,
6153
org.gradle.tooling.model,
6254
org.gradle.tooling.model.eclipse,

bundles/io.openliberty.tools.eclipse.ui/plugin.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright (c) 2022, 2024 IBM Corporation and others.
3+
Copyright (c) 2022, 2025 IBM Corporation and others.
44
55
This program and the accompanying materials are made available under the
66
terms of the Eclipse Public License v. 2.0 which is available at
@@ -682,15 +682,6 @@
682682
</run>
683683
</runtime>
684684
</extension>
685-
686-
<!-- Delegate-->
687-
<extension point="org.eclipse.tm.terminal.view.ui.launcherDelegates">
688-
<delegate
689-
class="io.openliberty.tools.eclipse.ui.terminal.LocalDevModeLauncherDelegate"
690-
id="io.openliberty.tools.eclipse.ui.terminal.local.devmode.launcher.delegate"
691-
label="io.openliberty.tools.eclipse.ui.terminal.local.devmode.launcher.delegate.label">
692-
</delegate>
693-
</extension>
694685

695686
<!-- Trace-->
696687
<extension

bundles/io.openliberty.tools.eclipse.ui/src/io/openliberty/tools/eclipse/CommandBuilder.java

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.io.File;
1616
import java.nio.file.Path;
1717
import java.nio.file.Paths;
18+
1819
import org.eclipse.osgi.util.NLS;
1920

2021
import io.openliberty.tools.eclipse.logging.Trace;
@@ -42,38 +43,38 @@ private CommandBuilder(String projectPath, String pathEnv, boolean isMaven) {
4243
}
4344

4445
/**
45-
* Returns the full Maven command to run on the terminal.
46+
* Returns the full Maven command to run.
4647
*
4748
* @param projectPath The project's path.
4849
* @param cmdArgs The mvn command args
4950
* @param pathEnv The PATH env var
5051
*
51-
* @return The full Maven command to run on the terminal.
52+
* @return The full Maven command to run.
5253
*
5354
* @throws CommandNotFoundException
5455
*/
55-
public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv, boolean printCmd)
56+
public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv)
5657
throws CommandBuilder.CommandNotFoundException {
5758
if (Trace.isEnabled()) {
5859
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs });
5960
}
6061
CommandBuilder builder = new CommandBuilder(projectPath, pathEnv, true);
6162
String cmd = builder.getCommand();
62-
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs, printCmd);
63+
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs);
6364
if (Trace.isEnabled()) {
6465
Trace.getTracer().traceExit(Trace.TRACE_TOOLS, cmdLine);
6566
}
6667
return cmdLine;
6768
}
6869

69-
public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv, boolean printCmd)
70+
public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv)
7071
throws CommandBuilder.CommandNotFoundException {
7172
if (Trace.isEnabled()) {
7273
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs });
7374
}
7475
CommandBuilder builder = new CommandBuilder(projectPath, pathEnv, false);
7576
String cmd = builder.getCommand();
76-
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs, printCmd);
77+
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs);
7778
if (Trace.isEnabled()) {
7879
Trace.getTracer().traceExit(Trace.TRACE_TOOLS, cmdLine);
7980
}
@@ -150,14 +151,15 @@ private String getCommandFromPreferences() throws IllegalStateException {
150151
String installLocPref = getInstallLocationPreferenceString();
151152
if (installLocPref == null || installLocPref.isBlank() || installLocPref.isEmpty()) {
152153
if (Trace.isEnabled()) {
153-
Trace.getTracer().trace(Trace.TRACE_TOOLS, "The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty");
154+
Trace.getTracer().trace(Trace.TRACE_TOOLS,
155+
"The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty");
154156
}
155157
return null;
156-
}
157-
158+
}
159+
158160
File tempCmdFile = new File(installLocPref + File.separator + "bin" + File.separator + getExecBaseName());
159161
String cmdPathStr = tempCmdFile.getPath();
160-
162+
161163
if (tempCmdFile.exists()) {
162164
if (Trace.isEnabled()) {
163165
Trace.getTracer().trace(Trace.TRACE_TOOLS, "Found mvn/gradle from preference at path: " + cmdPathStr);
@@ -202,20 +204,10 @@ private String getCommandFromPathEnvVar() throws IllegalStateException {
202204
return foundCmd;
203205
}
204206

205-
private String getCommandLineFromArgs(String cmd, String cmdArgs, boolean printCmd) {
207+
private String getCommandLineFromArgs(String cmd, String cmdArgs) {
206208
// Put it all together.
207209
StringBuilder sb = new StringBuilder();
208210
if (cmd != null) {
209-
if (printCmd) {
210-
if (Utils.isWindows()) {
211-
sb.append("/c ");
212-
sb.append("echo && ");
213-
sb.append("echo Liberty Tools running command: " + cmd + " " + cmdArgs);
214-
sb.append(" from directory: " + projectPath + " && ");
215-
} else {
216-
sb.append(" -x ");
217-
}
218-
}
219211
sb.append(cmd).append(" ").append(cmdArgs);
220212
}
221213

0 commit comments

Comments
 (0)