Skip to content
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
10 changes: 1 addition & 9 deletions bundles/io.openliberty.tools.eclipse.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@ Import-Package: org.eclipse.cdt.launch.ui,
org.eclipse.osgi.service.debug,
org.eclipse.osgi.util,
org.eclipse.swt.custom,
org.eclipse.tm.internal.terminal.provisional.api,
org.eclipse.tm.terminal.connector.local.launcher,
org.eclipse.tm.terminal.view.core,
org.eclipse.tm.terminal.view.core.interfaces,
org.eclipse.tm.terminal.view.core.interfaces.constants,
org.eclipse.tm.terminal.view.ui.interfaces,
org.eclipse.tm.terminal.view.ui.launcher,
org.eclipse.tm.terminal.view.ui.manager,
org.eclipse.tm.terminal.view.ui.tabs,
org.eclipse.ui.console,
org.gradle.tooling,
org.gradle.tooling.model,
org.gradle.tooling.model.eclipse,
Expand Down
11 changes: 1 addition & 10 deletions bundles/io.openliberty.tools.eclipse.ui/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022, 2024 IBM Corporation and others.
Copyright (c) 2022, 2025 IBM Corporation and others.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -682,15 +682,6 @@
</run>
</runtime>
</extension>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the last modified year in the copyright in this file and the test files.

<!-- Delegate-->
<extension point="org.eclipse.tm.terminal.view.ui.launcherDelegates">
<delegate
class="io.openliberty.tools.eclipse.ui.terminal.LocalDevModeLauncherDelegate"
id="io.openliberty.tools.eclipse.ui.terminal.local.devmode.launcher.delegate"
label="io.openliberty.tools.eclipse.ui.terminal.local.devmode.launcher.delegate.label">
</delegate>
</extension>

<!-- Trace-->
<extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.eclipse.osgi.util.NLS;

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

/**
* Returns the full Maven command to run on the terminal.
* Returns the full Maven command to run.
*
* @param projectPath The project's path.
* @param cmdArgs The mvn command args
* @param pathEnv The PATH env var
*
* @return The full Maven command to run on the terminal.
* @return The full Maven command to run.
*
* @throws CommandNotFoundException
*/
public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv, boolean printCmd)
public static String getMavenCommandLine(String projectPath, String cmdArgs, String pathEnv)
throws CommandBuilder.CommandNotFoundException {
if (Trace.isEnabled()) {
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs });
}
CommandBuilder builder = new CommandBuilder(projectPath, pathEnv, true);
String cmd = builder.getCommand();
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs, printCmd);
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs);
if (Trace.isEnabled()) {
Trace.getTracer().traceExit(Trace.TRACE_TOOLS, cmdLine);
}
return cmdLine;
}

public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv, boolean printCmd)
public static String getGradleCommandLine(String projectPath, String cmdArgs, String pathEnv)
throws CommandBuilder.CommandNotFoundException {
if (Trace.isEnabled()) {
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { projectPath, cmdArgs });
}
CommandBuilder builder = new CommandBuilder(projectPath, pathEnv, false);
String cmd = builder.getCommand();
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs, printCmd);
String cmdLine = builder.getCommandLineFromArgs(cmd, cmdArgs);
if (Trace.isEnabled()) {
Trace.getTracer().traceExit(Trace.TRACE_TOOLS, cmdLine);
}
Expand Down Expand Up @@ -150,14 +151,15 @@ private String getCommandFromPreferences() throws IllegalStateException {
String installLocPref = getInstallLocationPreferenceString();
if (installLocPref == null || installLocPref.isBlank() || installLocPref.isEmpty()) {
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, "The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty");
Trace.getTracer().trace(Trace.TRACE_TOOLS,
"The mvn/gradle preference path: " + installLocPref + " was null, blank, or empty");
}
return null;
}
}

File tempCmdFile = new File(installLocPref + File.separator + "bin" + File.separator + getExecBaseName());
String cmdPathStr = tempCmdFile.getPath();

if (tempCmdFile.exists()) {
if (Trace.isEnabled()) {
Trace.getTracer().trace(Trace.TRACE_TOOLS, "Found mvn/gradle from preference at path: " + cmdPathStr);
Expand Down Expand Up @@ -202,20 +204,10 @@ private String getCommandFromPathEnvVar() throws IllegalStateException {
return foundCmd;
}

private String getCommandLineFromArgs(String cmd, String cmdArgs, boolean printCmd) {
private String getCommandLineFromArgs(String cmd, String cmdArgs) {
// Put it all together.
StringBuilder sb = new StringBuilder();
if (cmd != null) {
if (printCmd) {
if (Utils.isWindows()) {
sb.append("/c ");
sb.append("echo && ");
sb.append("echo Liberty Tools running command: " + cmd + " " + cmdArgs);
sb.append(" from directory: " + projectPath + " && ");
} else {
sb.append(" -x ");
}
}
sb.append(cmd).append(" ").append(cmdArgs);
}

Expand Down
Loading
Loading