1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

Bug 339703 IBuildRunner should be an abstract base class

This commit is contained in:
James Blackburn 2011-03-11 15:35:46 +00:00
parent ebb5a4dafd
commit 88729ccc17
6 changed files with 25 additions and 18 deletions

View file

@ -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. A runner for the build. Overrides or extends the built-in external and internal build runners.
</documentation> </documentation>
<appInfo> <appInfo>
<meta.attribute kind="java" basedOn=":org.eclipse.cdt.managedbuilder.core.IBuildRunner"/> <meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.AbstractBuildRunner:"/>
</appInfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Wind River Systems - Initial API and implementation * Wind River Systems - Initial API and implementation
* James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
@ -23,21 +24,21 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @author Doug Schaefer * @author Doug Schaefer
* @since 8.0 * @since 8.0
*/ */
public interface IBuildRunner { public abstract class AbstractBuildRunner {
/** /**
* Perform the build. * Perform the build.
* *
* @param kind kind from the IncrementalProjectBuilder * @param kind kind from the IncrementalProjectBuilder
* @param project project being built * @param project project being built
* @param configuration configuration being built * @param configuration configuration being built
* @param console console to use for build output * @param console console to use for build output
* @param markerGenerator generator to add markers for build problems * @param markerGenerator generator to add markers for build problems
* @param monitor progress monitor * @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, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException; IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Wind River Systems - Initial API and implementation * Wind River Systems - Initial API and implementation
* James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
@ -65,7 +66,7 @@ import org.eclipse.core.runtime.SubProgressMonitor;
* @author dschaefer * @author dschaefer
* @since 8.0 * @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_CLEAN = "ManagedMakeBuilder.type.clean"; //$NON-NLS-1$
private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$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 NEWLINE = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
private static final String PATH = "PATH"; //$NON-NLS-1$ private static final String PATH = "PATH"; //$NON-NLS-1$
@Override
public boolean invokeBuild(int kind, IProject project, IConfiguration configuration, public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
IBuilder builder, IConsole console, IMarkerGenerator markerGenerator, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException { IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Intel Corporation - Initial API and implementation * Intel Corporation - Initial API and implementation
* James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
@ -332,6 +333,6 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
* @return build runner * @return build runner
* @since 8.0 * @since 8.0
*/ */
public IBuildRunner getBuildRunner() throws CoreException; public AbstractBuildRunner getBuildRunner() throws CoreException;
} }

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Wind River Systems - Initial API and implementation * Wind River Systems - Initial API and implementation
* James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core; package org.eclipse.cdt.managedbuilder.core;
@ -43,7 +44,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
* @author dschaefer * @author dschaefer
* @since 8.0 * @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 INTERNAL_BUILDER = "ManagedMakeBuilder.message.internal.builder"; //$NON-NLS-1$
private static final String TYPE_INC = "ManagedMakeBuider.type.incremental"; //$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 NOTHING_BUILT = "ManagedMakeBuilder.message.no.build"; //$NON-NLS-1$
private static final String BUILD_ERROR = "ManagedMakeBuilder.message.error"; //$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, public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
IBuilder builder, IConsole console, IMarkerGenerator markerGenerator, IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException { IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {

View file

@ -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 * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Intel Corporation - Initial API and implementation * Intel Corporation - Initial API and implementation
* James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.core; 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.BuildException;
import org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner; import org.eclipse.cdt.managedbuilder.core.ExternalBuildRunner;
import org.eclipse.cdt.managedbuilder.core.IBuildObject; 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.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement; import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
@ -140,7 +141,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private ICommandLauncher fCommandLauncher = null; private ICommandLauncher fCommandLauncher = null;
private IConfigurationElement fCommandLauncherElement = null; private IConfigurationElement fCommandLauncherElement = null;
private IBuildRunner fBuildRunner = null; private AbstractBuildRunner fBuildRunner = null;
private IConfigurationElement fBuildRunnerElement = null; private IConfigurationElement fBuildRunnerElement = null;
/* /*
@ -2639,14 +2640,14 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
return fCommandLauncher; return fCommandLauncher;
} }
public IBuildRunner getBuildRunner() throws CoreException { public AbstractBuildRunner getBuildRunner() throws CoreException {
// Already defined // Already defined
if (fBuildRunner != null) if (fBuildRunner != null)
return fBuildRunner; return fBuildRunner;
// Instantiate from model // Instantiate from model
if (fBuildRunnerElement != null) { if (fBuildRunnerElement != null) {
fBuildRunner = (IBuildRunner)fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER); fBuildRunner = (AbstractBuildRunner)fBuildRunnerElement.createExecutableExtension(ATTRIBUTE_BUILD_RUNNER);
return fBuildRunner; return fBuildRunner;
} }