1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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 <planger@eclipsesource.com>
This commit is contained in:
Philip Langer 2016-11-01 18:11:00 +01:00 committed by Gerrit Code Review @ Eclipse.org
parent 7181c4b9e9
commit ab7afbf0aa
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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