From 88729ccc17c125bd7f2f7665ab81881ac7bdba01 Mon Sep 17 00:00:00 2001 From: James Blackburn Date: Fri, 11 Mar 2011 15:35:46 +0000 Subject: [PATCH] Bug 339703 IBuildRunner should be an abstract base class --- .../schema/buildDefinitions.exsd | 2 +- .../{IBuildRunner.java => AbstractBuildRunner.java} | 13 +++++++------ .../managedbuilder/core/ExternalBuildRunner.java | 6 ++++-- .../eclipse/cdt/managedbuilder/core/IBuilder.java | 5 +++-- .../managedbuilder/core/InternalBuildRunner.java | 6 ++++-- .../cdt/managedbuilder/internal/core/Builder.java | 11 ++++++----- 6 files changed, 25 insertions(+), 18 deletions(-) rename build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/{IBuildRunner.java => AbstractBuildRunner.java} (82%) diff --git a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd index f10e4a4279e..538c8417e4b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd +++ b/build/org.eclipse.cdt.managedbuilder.core/schema/buildDefinitions.exsd @@ -1779,7 +1779,7 @@ If the builder supports specifying custom number of parallel jobs, the option de A runner for the build. Overrides or extends the built-in external and internal build runners. - + diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java similarity index 82% rename from build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildRunner.java rename to build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java index 643ed642bdf..d387f1ee47b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuildRunner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/AbstractBuildRunner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Wind River Systems and others. + * Copyright (c) 2010, 2011 Wind River 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 @@ -7,6 +7,7 @@ * * Contributors: * Wind River Systems - Initial API and implementation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; @@ -23,21 +24,21 @@ import org.eclipse.core.runtime.IProgressMonitor; * @author Doug Schaefer * @since 8.0 */ -public interface IBuildRunner { +public abstract class AbstractBuildRunner { /** * Perform the build. - * + * * @param kind kind from the IncrementalProjectBuilder * @param project project being built * @param configuration configuration being built * @param console console to use for build output * @param markerGenerator generator to add markers for build problems * @param monitor progress monitor - * @throws CoreException standard core exception of something goes wrong + * @throws CoreException standard core exception if something goes wrong */ - public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, + public abstract boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException; - + } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java index edf1e170f68..30d076a5d15 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ExternalBuildRunner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Wind River Systems and others. + * Copyright (c) 2010, 2011 Wind River 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 @@ -7,6 +7,7 @@ * * Contributors: * Wind River Systems - Initial API and implementation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; @@ -65,7 +66,7 @@ import org.eclipse.core.runtime.SubProgressMonitor; * @author dschaefer * @since 8.0 */ -public class ExternalBuildRunner implements IBuildRunner { +public class ExternalBuildRunner extends AbstractBuildRunner { private static final String TYPE_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$ private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$ @@ -74,6 +75,7 @@ public class ExternalBuildRunner implements IBuildRunner { private static final String NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ private static final String PATH = "PATH"; //$NON-NLS-1$ + @Override public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java index ca8c08a4f83..3a60bedc114 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/IBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2010 Intel Corporation and others. + * Copyright (c) 2004, 2011 Intel Corporation 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 @@ -7,6 +7,7 @@ * * Contributors: * Intel Corporation - Initial API and implementation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; @@ -332,6 +333,6 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo { * @return build runner * @since 8.0 */ - public IBuildRunner getBuildRunner() throws CoreException; + public AbstractBuildRunner getBuildRunner() throws CoreException; } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java index 8c3c2df24df..b8f525e1a1b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/InternalBuildRunner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Wind River Systems and others. + * Copyright (c) 2010, 2011 Wind River 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 @@ -7,6 +7,7 @@ * * Contributors: * Wind River Systems - Initial API and implementation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; @@ -43,7 +44,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; * @author dschaefer * @since 8.0 */ -public class InternalBuildRunner implements IBuildRunner { +public class InternalBuildRunner extends AbstractBuildRunner { private static final String INTERNAL_BUILDER = "ManagedMakeBuilder.message.internal.builder"; //$NON-NLS-1$ private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$NON-NLS-1$ @@ -60,6 +61,7 @@ public class InternalBuildRunner implements IBuildRunner { private static final String NOTHING_BUILT = "ManagedMakeBuilder.message.no.build"; //$NON-NLS-1$ private static final String BUILD_ERROR = "ManagedMakeBuilder.message.error"; //$NON-NLS-1$ + @Override public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException { diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java index 0b66a2ac28f..954bfba324f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 Intel Corporation and others. + * Copyright (c) 2004, 2011 Intel Corporation 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 @@ -7,6 +7,7 @@ * * Contributors: * Intel Corporation - Initial API and implementation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.managedbuilder.internal.core; @@ -40,7 +41,7 @@ import org.eclipse.cdt.core.settings.model.util.LanguageSettingEntriesSerializer import org.eclipse.cdt.managedbuilder.core.BuildException; import org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner; import org.eclipse.cdt.managedbuilder.core.IBuildObject; -import org.eclipse.cdt.managedbuilder.core.IBuildRunner; +import org.eclipse.cdt.managedbuilder.core.AbstractBuildRunner; import org.eclipse.cdt.managedbuilder.core.IBuilder; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement; @@ -140,7 +141,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider private ICommandLauncher fCommandLauncher = null; private IConfigurationElement fCommandLauncherElement = null; - private IBuildRunner fBuildRunner = null; + private AbstractBuildRunner fBuildRunner = null; private IConfigurationElement fBuildRunnerElement = null; /* @@ -2639,14 +2640,14 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider return fCommandLauncher; } - public IBuildRunner getBuildRunner() throws CoreException { + public AbstractBuildRunner getBuildRunner() throws CoreException { // Already defined if (fBuildRunner != null) return fBuildRunner; // Instantiate from model if (fBuildRunnerElement != null) { - fBuildRunner = (IBuildRunner)fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER); + fBuildRunner = (AbstractBuildRunner)fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER); return fBuildRunner; }