From ab7afbf0aa0583b96260c2bae8f38403ab1faca6 Mon Sep 17 00:00:00 2001 From: Philip Langer Date: Tue, 1 Nov 2016 18:11:00 +0100 Subject: [PATCH] Bug 506843: Reset buildFailed flag on buildForLaunch Since delegate instances are cached and reused for subsequent launches, we have to reset the buildFailed flag on subsequent builds (i.e., calls of buildForLaunch). Otherwise, this flag will remain to be set to true after a failed/cancelled build for the entire lifetime of this delegate, even if a project has been re-launched and the build succeeded. If the flag remains to be true, the dialog keeps popping up asking the user whether to succeed with the launch with errors in the project, even if the build succeeded and there are no errors any more. Change-Id: I51aece90154f817542ed7548ec4c36591b19eaec Signed-off-by: Philip Langer --- .../src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java | 4 +++- .../src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java index 23e1b552431..c9fe5ec1f5d 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 QNX Software Systems and others. + * Copyright (c) 2005, 2016 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ * Anton Leherbauer (Wind River Systems) - bug 224187 * Alex Collins (Broadcom Corp.) - choose build config automatically * James Blackburn (Broadcom Corp.) + * Philip Langer (EclipseSource Services GmbH) - bug 506843 *******************************************************************************/ package org.eclipse.cdt.launch; @@ -548,6 +549,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat @Override public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { + buildFailed = false; workspaceBuildBeforeLaunch = true; // check the build before launch setting and honor it diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java index a2fbd4e59b0..c9a6ac24590 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java @@ -9,6 +9,7 @@ * Ken Ryall (Nokia) * James Blackburn (Broadcom Corp.) * Marc Khouzam (Ericsson) - Modernize Run launch (bug 464636) + * Philip Langer (EclipseSource Services GmbH) - bug 506843 *******************************************************************************/ package org.eclipse.cdt.launch; @@ -321,6 +322,8 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega */ protected void buildProject(final IProject project, final String buildConfigID, IProgressMonitor monitor) throws CoreException { final int TOTAL_TICKS = 1000; + + buildFailed = false; // Some day, this will hopefully be a simple pass-thru to a cdt.core // utility. See bug 313927