diff --git a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java index 99c169e941a..8be04d5d92d 100644 --- a/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java +++ b/build/org.eclipse.cdt.build.gcc.core/src/org/eclipse/cdt/build/gcc/core/GCCToolChain.java @@ -73,7 +73,7 @@ public class GCCToolChain extends PlatformObject implements IToolChain { this.version = version; this.name = id + " - " + version; //$NON-NLS-1$ this.path = path; - this.prefix = prefix; + this.prefix = prefix != null ? prefix : ""; if (path != null) { StringBuilder pathString = new StringBuilder(); @@ -393,15 +393,15 @@ public class GCCToolChain extends PlatformObject implements IToolChain { @Override public String[] getCompileCommands() { - return new String[] { "gcc", "g++", "clang", "clang++", "cc", "c++" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + return new String[] { prefix + "gcc", prefix + "g++", prefix + "clang", prefix + "clang++", prefix + "cc", prefix + "c++" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } @Override public String[] getCompileCommands(ILanguage language) { if (GPPLanguage.ID.equals(language.getId())) { - return new String[] { "g++", "clang++", "c++" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return new String[] { prefix + "g++", prefix + "clang++", prefix + "c++" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } else if (GCCLanguage.ID.equals(language.getId())) { - return new String[] { "gcc", "clang", "cc" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return new String[] { prefix + "gcc", prefix + "clang", prefix + "cc" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } else { return new String[0]; } diff --git a/build/org.eclipse.cdt.cmake.core/plugin.xml b/build/org.eclipse.cdt.cmake.core/plugin.xml index 14b2864eb46..2673e5b6d95 100644 --- a/build/org.eclipse.cdt.cmake.core/plugin.xml +++ b/build/org.eclipse.cdt.cmake.core/plugin.xml @@ -1,6 +1,7 @@ + diff --git a/build/org.eclipse.cdt.cmake.core/schema/toolChainProvider.exsd b/build/org.eclipse.cdt.cmake.core/schema/toolChainProvider.exsd new file mode 100644 index 00000000000..19d844273e3 --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/schema/toolChainProvider.exsd @@ -0,0 +1,102 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java index b12a8a694da..82cc0aea8de 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeProjectGenerator.java @@ -22,7 +22,9 @@ import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; import org.eclipse.tools.templates.freemarker.FMProjectGenerator; import org.eclipse.tools.templates.freemarker.SourceRoot; import org.osgi.framework.Bundle; @@ -68,6 +70,9 @@ public class CMakeProjectGenerator extends FMProjectGenerator { } else { entries.add(CoreModel.newSourceEntry(getProject().getFullPath())); } + + entries.add(CoreModel.newOutputEntry(getProject().getFolder("build").getFullPath(), + new IPath[] { new Path("**/CMakeFiles/**") })); CoreModel.getDefault().create(project).setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]), monitor); } diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeToolChainEvent.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeToolChainEvent.java new file mode 100644 index 00000000000..962f1f2accc --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/CMakeToolChainEvent.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.cdt.cmake.core; + +/** + * Event occured with CMake ToolChain Files, either added or removed. + */ +public class CMakeToolChainEvent { + + /** + * ToolChain file has been added. + */ + public static final int ADDED = 1; + + /** + * ToolChain File has been removed. + */ + public static final int REMOVED = 2; + + private final int type; + private final ICMakeToolChainFile toolChainFile; + + public CMakeToolChainEvent(int type, ICMakeToolChainFile toolChainFile) { + this.type = type; + this.toolChainFile = toolChainFile; + } + + public int getType() { + return type; + } + + public ICMakeToolChainFile getToolChainFile() { + return toolChainFile; + } + +} diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainListener.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainListener.java new file mode 100644 index 00000000000..447fe68fee5 --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainListener.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.cdt.cmake.core; + +/** + * Listener for toolchain events. + */ +public interface ICMakeToolChainListener { + + void handleCMakeToolChainEvent(CMakeToolChainEvent event); + +} diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainManager.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainManager.java index a6d11e94582..b522fb1d0ef 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainManager.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainManager.java @@ -30,4 +30,8 @@ public interface ICMakeToolChainManager { Collection getToolChainFiles(); + void addListener(ICMakeToolChainListener listener); + + void removeListener(ICMakeToolChainListener listener); + } diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainProvider.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainProvider.java new file mode 100644 index 00000000000..1620c5995f3 --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/ICMakeToolChainProvider.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright (c) 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 + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ +package org.eclipse.cdt.cmake.core; + +public interface ICMakeToolChainProvider { + + void init(ICMakeToolChainManager manager); + +} diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java index 6efa8bf43ae..9db982f7ce4 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* -// * Copyright (c) 2015, 2016 QNX Software Systems and others. + * Copyright (c) 2015, 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 @@ -28,10 +28,13 @@ import org.eclipse.cdt.core.build.IToolChain; import org.eclipse.cdt.core.model.ICModelMarker; import org.eclipse.cdt.core.resources.IConsole; import org.eclipse.core.resources.IBuildConfiguration; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -96,7 +99,8 @@ public class CMakeBuildConfiguration extends CBuildConfiguration { if (!Files.exists(buildDir.resolve("Makefile"))) { //$NON-NLS-1$ List command = new ArrayList<>(); - // TODO assuming cmake is in the path here, probably need a preference in case it isn't. + // TODO assuming cmake is in the path here, probably need a + // preference in case it isn't. Path cmakePath = CBuildConfiguration.getCommandFromPath(Paths.get("cmake")); //$NON-NLS-1$ if (cmakePath == null) { if (!Platform.getOS().equals(Platform.OS_WIN32)) { @@ -127,7 +131,8 @@ public class CMakeBuildConfiguration extends CBuildConfiguration { try (ErrorParserManager epm = new ErrorParserManager(project, getBuildDirectoryURI(), this, getToolChain().getErrorParserIds())) { - // TODO need to figure out which builder to call. Hardcoding to make for now. + // TODO need to figure out which builder to call. Hardcoding to + // make for now. List command = Arrays.asList("make"); //$NON-NLS-1$ ProcessBuilder processBuilder = new ProcessBuilder(command).directory(buildDir.toFile()); setBuildEnvironment(processBuilder.environment()); diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationDelegate.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationDelegate.java index 1d862296f6f..a2a5435d23f 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationDelegate.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationDelegate.java @@ -55,7 +55,7 @@ public class CMakeLaunchConfigurationDelegate extends LaunchConfigurationTargete IToolChain toolChain = tcs.iterator().next(); IProject project = getProject(configuration); - ICBuildConfiguration config = configManager.createBuildConfiguration(project, toolChain, "run", monitor); //$NON-NLS-1$ + ICBuildConfiguration config = configManager.getBuildConfiguration(project, toolChain, "run", monitor); //$NON-NLS-1$ if (config != null) { IProjectDescription desc = project.getDescription(); diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationProvider.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationProvider.java index bf0e83536ad..adf1bb8d358 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationProvider.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeLaunchConfigurationProvider.java @@ -28,35 +28,11 @@ import org.eclipse.launchbar.core.target.ILaunchTargetManager; public class CMakeLaunchConfigurationProvider extends AbstractLaunchConfigProvider { - private final ICMakeToolChainManager manager = Activator.getService(ICMakeToolChainManager.class); - private final IToolChainManager tcManager = Activator.getService(IToolChainManager.class); - private Map configs = new HashMap<>(); @Override public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException { - if (ILaunchTargetManager.localLaunchTargetTypeId.equals(target.getTypeId())) { - return true; - } - - String os = target.getAttribute(ILaunchTarget.ATTR_OS, ""); //$NON-NLS-1$ - if (os.isEmpty()) { - return false; - } - - String arch = target.getAttribute(ILaunchTarget.ATTR_ARCH, ""); //$NON-NLS-1$ - if (arch.isEmpty()) { - return false; - } - - Map properties = new HashMap<>(); - properties.put(IToolChain.ATTR_OS, os); - properties.put(IToolChain.ATTR_ARCH, arch); - if (manager.getToolChainFilesMatching(properties).isEmpty()) { - return false; - } - - return !tcManager.getToolChainsMatching(properties).isEmpty(); + return ILaunchTargetManager.localLaunchTargetTypeId.equals(target.getTypeId()); } @Override diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeToolChainManager.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeToolChainManager.java index 8d1b2c740cb..15c42839b5d 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeToolChainManager.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeToolChainManager.java @@ -13,12 +13,22 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import org.eclipse.cdt.cmake.core.CMakeToolChainEvent; import org.eclipse.cdt.cmake.core.ICMakeToolChainFile; +import org.eclipse.cdt.cmake.core.ICMakeToolChainListener; import org.eclipse.cdt.cmake.core.ICMakeToolChainManager; +import org.eclipse.cdt.cmake.core.ICMakeToolChainProvider; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.ISafeRunnable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.preferences.InstanceScope; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -30,6 +40,8 @@ public class CMakeToolChainManager implements ICMakeToolChainManager { private static final String N = "n"; //$NON-NLS-1$ private static final String PATH = "__path"; //$NON-NLS-1$ + private final List listeners = new LinkedList<>(); + private Preferences getPreferences() { return InstanceScope.INSTANCE.getNode(Activator.getId()).node("cmakeToolchains"); //$NON-NLS-1$ } @@ -57,6 +69,19 @@ public class CMakeToolChainManager implements ICMakeToolChainManager { } // TODO discovery + IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(Activator.getId(), + "toolChainProvider"); //$NON-NLS-1$ + for (IConfigurationElement element : point.getConfigurationElements()) { + if (element.getName().equals("provider")) { //$NON-NLS-1$ + try { + ICMakeToolChainProvider provider = (ICMakeToolChainProvider) element + .createExecutableExtension("class"); //$NON-NLS-1$ + provider.init(this); + } catch (ClassCastException | CoreException e) { + Activator.log(e); + } + } + } } } @@ -92,11 +117,14 @@ public class CMakeToolChainManager implements ICMakeToolChainManager { } catch (BackingStoreException e) { Activator.log(e); } + + fireEvent(new CMakeToolChainEvent(CMakeToolChainEvent.ADDED, file)); } @Override public void removeToolChainFile(ICMakeToolChainFile file) { init(); + fireEvent(new CMakeToolChainEvent(CMakeToolChainEvent.REMOVED, file)); files.remove(file.getPath()); String n = ((CMakeToolChainFile) file).n; @@ -143,4 +171,30 @@ public class CMakeToolChainManager implements ICMakeToolChainManager { return matches; } + @Override + public void addListener(ICMakeToolChainListener listener) { + listeners.add(listener); + } + + @Override + public void removeListener(ICMakeToolChainListener listener) { + listeners.remove(listener); + } + + private void fireEvent(CMakeToolChainEvent event) { + for (ICMakeToolChainListener listener : listeners) { + SafeRunner.run(new ISafeRunnable() { + @Override + public void run() throws Exception { + listener.handleCMakeToolChainEvent(event); + } + + @Override + public void handleException(Throwable exception) { + Activator.log(exception); + } + }); + } + } + } diff --git a/build/org.eclipse.cdt.cmake.ui/plugin.xml b/build/org.eclipse.cdt.cmake.ui/plugin.xml index c76595197c8..09a01d710fb 100644 --- a/build/org.eclipse.cdt.cmake.ui/plugin.xml +++ b/build/org.eclipse.cdt.cmake.ui/plugin.xml @@ -23,6 +23,7 @@ diff --git a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/CMakePreferencePage.java b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/CMakePreferencePage.java index e6cae98fb80..94406b75ac5 100644 --- a/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/CMakePreferencePage.java +++ b/build/org.eclipse.cdt.cmake.ui/src/org/eclipse/cdt/cmake/ui/internal/CMakePreferencePage.java @@ -184,6 +184,9 @@ public class CMakePreferencePage extends PreferencePage implements IWorkbenchPre manager.removeToolChainFile(file); } + filesToAdd.clear(); + filesToRemove.clear(); + return true; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java index b82751612b9..346a9b70c65 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java @@ -153,7 +153,10 @@ public class BinaryRunner { */ public void waitIfRunning() { try { - runnerJob.join(); + Job currentJob = Job.getJobManager().currentJob(); + if (currentJob != null && !currentJob.equals(runnerJob)) { + runnerJob.join(); + } } catch (InterruptedException e) { } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java index 9f056db9cd1..28b5020222e 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java @@ -36,6 +36,8 @@ import org.eclipse.cdt.core.IMarkerGenerator; import org.eclipse.cdt.core.ProblemMarkerInfo; import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.IBinaryContainer; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICModelMarker; import org.eclipse.cdt.core.model.ICProject; @@ -58,6 +60,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; @@ -174,15 +177,7 @@ public abstract class CBuildConfiguration extends PlatformObject } IFolder buildFolder = buildRootFolder.getFolder(name); if (!buildFolder.exists()) { - buildFolder.create(true, true, new NullProgressMonitor()); - buildFolder.setDerived(true, null); - ICProject cproject = CoreModel.getDefault().create(getProject()); - IOutputEntry output = CoreModel.newOutputEntry(buildFolder.getFullPath()); - IPathEntry[] oldEntries = cproject.getRawPathEntries(); - IPathEntry[] newEntries = new IPathEntry[oldEntries.length + 1]; - System.arraycopy(oldEntries, 0, newEntries, 0, oldEntries.length); - newEntries[oldEntries.length] = output; - cproject.setRawPathEntries(newEntries, null); + buildFolder.create(IResource.FORCE | IResource.DERIVED, true, new NullProgressMonitor()); } return buildFolder; @@ -200,6 +195,20 @@ public abstract class CBuildConfiguration extends PlatformObject CCorePlugin.getDefault().getBuildEnvironmentManager().setEnvironment(env, config, true); } + @Override + public IBinary[] getBuildOutput() throws CoreException { + ICProject cproject = CoreModel.getDefault().create(config.getProject()); + IBinaryContainer binaries = cproject.getBinaryContainer(); + IPath outputPath = getBuildContainer().getFullPath(); + List outputs = new ArrayList<>(); + for (IBinary binary : binaries.getBinaries()) { + if (binary.isExecutable() && outputPath.isPrefixOf(binary.getPath())) { + outputs.add(binary); + } + } + return outputs.toArray(new IBinary[outputs.size()]); + } + public void setActive(IProgressMonitor monitor) throws CoreException { IProject project = config.getProject(); if (config.equals(project.getActiveBuildConfig())) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfiguration.java index 59b8a8731f0..dc622120fe9 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfiguration.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfiguration.java @@ -10,6 +10,7 @@ package org.eclipse.cdt.core.build; import java.util.Map; import org.eclipse.cdt.core.envvar.IEnvironmentVariable; +import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.parser.IScannerInfoProvider; import org.eclipse.cdt.core.resources.IConsole; import org.eclipse.core.resources.IBuildConfiguration; @@ -59,4 +60,20 @@ public interface ICBuildConfiguration extends IAdaptable, IScannerInfoProvider { void clean(IConsole console, IProgressMonitor monitor) throws CoreException; + /** + * @return build output IContainer + * @throws CoreException + * @since 6.1 + */ + default IBinary[] getBuildOutput() throws CoreException { + return null; + } + + /** + * + * @param env + * @since 6.1 + */ + default void setBuildEnvironment(Map env) { + } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfigurationManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfigurationManager.java index fd655bc2178..44532edd952 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfigurationManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildConfigurationManager.java @@ -56,7 +56,7 @@ public interface ICBuildConfigurationManager { * @throws CoreException * @since 6.1 */ - ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, String launchMode, + ICBuildConfiguration getBuildConfiguration(IProject project, IToolChain toolChain, String launchMode, IProgressMonitor monitor) throws CoreException; /** diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java index 3da80f63bf8..a68e2287b5d 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java @@ -215,7 +215,7 @@ public class CBuildConfigurationManager implements ICBuildConfigurationManager, } @Override - public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, + public ICBuildConfiguration getBuildConfiguration(IProject project, IToolChain toolChain, String launchMode, IProgressMonitor monitor) throws CoreException { ICBuildConfigurationProvider provider = getProvider(project); if (provider != null) {