diff options
author | Alexander Fedorov | 2019-07-02 07:54:47 +0000 |
---|---|---|
committer | Paul Pazderski | 2019-07-05 10:38:18 +0000 |
commit | 324f7342257c184b49912010121da919ef076060 (patch) | |
tree | 7a44a78c858b52b9f9f7e6567087f30205b3c816 /org.eclipse.debug.core | |
parent | 9af85f069eb2845cb5e7a7d2cda8f3e32d8ba6a2 (diff) | |
download | eclipse.platform.debug-324f7342257c184b49912010121da919ef076060.tar.gz eclipse.platform.debug-324f7342257c184b49912010121da919ef076060.tar.xz eclipse.platform.debug-324f7342257c184b49912010121da919ef076060.zip |
Bug 529651 - Launch group launches do not build before launch
Launch group delegates the build flag resolution to IStatusHandler that
reads the IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH preference
Change-Id: If8c6b1bbf0987279228e89edfd76e36157f097c2
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java index 66b92886b..6a5c79613 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2016 QNX Software Systems and others. + * Copyright (c) 2009, 2019 QNX Software Systems and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -12,6 +12,7 @@ * QNX Software Systems - initial API and implementation * Freescale Semiconductor * SSI Schaefer + * Alexander Fedorov <alexander.fedorov@arsysop.ru> - Bug 529651 *******************************************************************************/ package org.eclipse.debug.internal.core.groups; @@ -58,6 +59,8 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat public static final int CODE_GROUP_LAUNCH_START = 233; public static final int CODE_GROUP_LAUNCH_DONE = 234; + private static final int CODE_BUILD_BEFORE_LAUNCH = 206; + private static final String NAME_PROP = "name"; //$NON-NLS-1$ private static final String ENABLED_PROP = "enabled"; //$NON-NLS-1$ private static final String ADOPT_PROP = "adoptIfRunning"; //$NON-NLS-1$ @@ -75,6 +78,8 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat private static final Status GROUP_LAUNCH_START = new Status(IStatus.INFO, DEBUG_CORE, CODE_GROUP_LAUNCH_START, IInternalDebugCoreConstants.EMPTY_STRING, null); private static final Status GROUP_LAUNCH_DONE = new Status(IStatus.INFO, DEBUG_CORE, CODE_GROUP_LAUNCH_DONE, IInternalDebugCoreConstants.EMPTY_STRING, null); + private static final Status BUILD_BEFORE_LAUNCH = new Status(IStatus.INFO, DEBUG_CORE, CODE_BUILD_BEFORE_LAUNCH, IInternalDebugCoreConstants.EMPTY_STRING, null); + @Override public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { return new GroupLaunch(configuration, mode); @@ -152,7 +157,17 @@ public class GroupLaunchConfigurationDelegate extends LaunchConfigurationDelegat ILaunch subLaunch = running.stream().findFirst().orElse(null); boolean launched = false; if (subLaunch == null) { - subLaunch = child.launch(localMode, monitor); + boolean build = true;// see DebugUIPreferenceInitializer + IStatusHandler buildHandler = DebugPlugin.getDefault().getStatusHandler(BUILD_BEFORE_LAUNCH); + try { + Object resolution = buildHandler.handleStatus(BUILD_BEFORE_LAUNCH, child); + if (resolution instanceof Boolean) { + build = ((Boolean) resolution).booleanValue(); + } + } catch (Exception e) { + // ignore and use default + } + subLaunch = child.launch(localMode, monitor, build); launched = true; } |