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

Use custom debug model #437

Closed
wants to merge 5 commits into from
Closed
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
18 changes: 14 additions & 4 deletions bundles/io.openliberty.tools.eclipse.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Bundle-SymbolicName: io.openliberty.tools.eclipse.ui;singleton:=true
Bundle-Version: 23.0.12.qualifier
Bundle-Activator: io.openliberty.tools.eclipse.LibertyDevPlugin
Export-Package: io.openliberty.tools.eclipse;x-friends:="io.openliberty.tools.eclipse.tests",
io.openliberty.tools.eclipse.debug;x-friends:="io.openliberty.tools.eclipse.tests",
io.openliberty.tools.eclipse.ui.dashboard;x-friends:="io.openliberty.tools.eclipse.tests",
io.openliberty.tools.eclipse.ui.launch;x-friends:="io.openliberty.tools.eclipse.tests",
io.openliberty.tools.eclipse.ui.launch.shortcuts;x-friends:="io.openliberty.tools.eclipse.tests",
io.openliberty.tools.eclipse.ui.preferences;x-friends:="io.openliberty.tools.eclipse.tests"
Require-Bundle: org.eclipse.ui,
scottkurz marked this conversation as resolved.
Show resolved Hide resolved
org.eclipse.equinox.preferences
org.eclipse.m2e.maven.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: io.openliberty.tools.eclipse.ui
Bundle-ActivationPolicy: lazy
Expand All @@ -21,13 +22,22 @@ Import-Package: org.eclipse.core.commands,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.core.runtime.jobs,
org.eclipse.core.runtime.preferences,
org.eclipse.debug.core,
org.eclipse.debug.core.model,
org.eclipse.debug.core.sourcelookup,
org.eclipse.debug.ui,
org.eclipse.debug.ui.sourcelookup,
org.eclipse.jdi,
org.eclipse.jdt.core,
org.eclipse.jdt.debug.core,
org.eclipse.jdt.debug.ui.launchConfigurations,
org.eclipse.jdt.launching,
org.eclipse.jdt.launching.sourcelookup.containers,
org.eclipse.jem.util.emf.workbench,
org.eclipse.m2e.core,
org.eclipse.m2e.core.embedder,
org.eclipse.m2e.core.project,
org.eclipse.osgi.service.debug,
org.eclipse.osgi.util,
org.eclipse.swt.custom,
Expand All @@ -40,7 +50,7 @@ Import-Package: org.eclipse.core.commands,
org.eclipse.tm.terminal.view.ui.launcher,
org.eclipse.tm.terminal.view.ui.manager,
org.eclipse.tm.terminal.view.ui.tabs,
org.eclipse.ui,
org.eclipse.ui.handlers,
org.eclipse.ui.plugin,
org.gradle.tooling,
org.gradle.tooling.model,
org.gradle.tooling.model.eclipse,
org.osgi.framework
19 changes: 18 additions & 1 deletion bundles/io.openliberty.tools.eclipse.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,31 @@
</command>
</menuContribution>
</extension>

<extension point="org.eclipse.debug.core.sourceLocators">
<sourceLocator
name="Liberty Source Lookup Director"
class="io.openliberty.tools.eclipse.debug.LibertySourceLookupDirector"
id="io.openliberty.tools.eclipse.debug.libertySourceLookupDirector">
</sourceLocator>
</extension>

<extension point="org.eclipse.debug.core.sourcePathComputers">
<sourcePathComputer
class="io.openliberty.tools.eclipse.debug.LibertySourcePathComputer"
id="io.openliberty.tools.eclipse.debug.libertySourcePathComputer">
</sourcePathComputer>
</extension>

<!-- Launch configuration -->
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
<launchConfigurationType
name="Liberty"
delegate="io.openliberty.tools.eclipse.ui.launch.LaunchConfigurationDelegateLauncher"
modes="run, debug"
id="io.openliberty.tools.eclipse.launch.type">
id="io.openliberty.tools.eclipse.launch.type"
sourceLocatorId="io.openliberty.tools.eclipse.debug.libertySourceLookupDirector"
sourcePathComputerId="io.openliberty.tools.eclipse.debug.libertySourcePathComputer">
</launchConfigurationType>
</extension>
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.osgi.util.NLS;

import io.openliberty.tools.eclipse.logging.Trace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jface.viewers.ISelection;
Expand All @@ -46,6 +47,7 @@

import io.openliberty.tools.eclipse.CommandBuilder.CommandNotFoundException;
import io.openliberty.tools.eclipse.Project.BuildType;
import io.openliberty.tools.eclipse.debug.DebugModeHandler;
import io.openliberty.tools.eclipse.logging.Logger;
import io.openliberty.tools.eclipse.logging.Trace;
import io.openliberty.tools.eclipse.messages.Messages;
Expand Down Expand Up @@ -151,7 +153,7 @@ public static DevModeOperations getInstance() {
* @param javaHomePath The configuration java installation home to be set in the terminal running dev mode.
* @param mode The configuration mode.
*/
public void start(IProject iProject, String parms, String javaHomePath, String mode) {
public void start(IProject iProject, String parms, String javaHomePath, ILaunch launch, String mode) {

if (Trace.isEnabled()) {
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { iProject, parms, javaHomePath, mode });
Expand Down Expand Up @@ -232,13 +234,13 @@ public void start(IProject iProject, String parms, String javaHomePath, String m
+ "does not appear to be a Maven or Gradle built project.");
}

// Start a terminal and run the application in dev mode.
startDevMode(cmd, projectName, projectPath, javaHomePath);

// If there is a debugPort, start the job to attach the debugger to the Liberty server JVM.
if (debugPort != null) {
debugModeHandler.startDebugAttacher(project, debugPort);
debugModeHandler.startDebugAttacher(project, launch, debugPort);
}

// Start a terminal and run the application in dev mode.
startDevMode(cmd, projectName, projectPath, javaHomePath);
} catch (CommandNotFoundException e) {
String msg = "Maven or Gradle command not found for project " + projectName;
if (Trace.isEnabled()) {
Expand Down Expand Up @@ -266,7 +268,7 @@ public void start(IProject iProject, String parms, String javaHomePath, String m
* @param javaHomePath The configuration java installation home to be set in the terminal running dev mode.
* @param mode The configuration mode.
*/
public void startInContainer(IProject iProject, String parms, String javaHomePath, String mode) {
public void startInContainer(IProject iProject, String parms, String javaHomePath, ILaunch launch, String mode) {

if (Trace.isEnabled()) {
Trace.getTracer().traceEntry(Trace.TRACE_TOOLS, new Object[] { iProject, parms, javaHomePath, mode });
Expand Down Expand Up @@ -347,13 +349,13 @@ public void startInContainer(IProject iProject, String parms, String javaHomePat
+ "does not appear to be a Maven or Gradle built project.");
}

// Start a terminal and run the application in dev mode.
startDevMode(cmd, projectName, projectPath, javaHomePath);

// If there is a debugPort, start the job to attach the debugger to the Liberty server JVM.
if (debugPort != null) {
debugModeHandler.startDebugAttacher(project, debugPort);
debugModeHandler.startDebugAttacher(project, launch, debugPort);
scottkurz marked this conversation as resolved.
Show resolved Hide resolved
}

// Start a terminal and run the application in dev mode.
startDevMode(cmd, projectName, projectPath, javaHomePath);
} catch (Exception e) {
String msg = "An error was detected during the start in container request on project " + projectName;
if (Trace.isEnabled()) {
Expand Down
Loading
Loading