Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeff Johnston2018-02-02 18:05:11 +0000
committerJeff Johnston2018-02-02 19:41:18 +0000
commit1ae547908b490c5f54c5847264533617813c07fe (patch)
treeb3b3b2ed57cbb3c025b47b7941c63ca23ac99fea /core
parent0e9460ec7b48d8171f570ca5982f0f399dc8705e (diff)
downloadorg.eclipse.cdt-1ae547908b490c5f54c5847264533617813c07fe.tar.gz
org.eclipse.cdt-1ae547908b490c5f54c5847264533617813c07fe.tar.xz
org.eclipse.cdt-1ae547908b490c5f54c5847264533617813c07fe.zip
Fix some API issues caused by some recent CommandLauncher additions
- remove new exposed field from CommandLauncherManager and add correct @since tags - create new ICommandLauncherFactory2 interface so that no additions are made to ICommandLauncherFactory - add @since tag for ICBuildCommandLauncher interface - make ContainerCommandLauncherFactory implement the new ICommandLauncherFactory2 as well as ICommandLauncherFactory Change-Id: I7bbacb59e284b43e6d142accf59b6ab9df274438
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java13
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory.java9
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory2.java31
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildCommandLauncher.java3
4 files changed, 41 insertions, 15 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java
index c8e9bd83922..6b87ed66501 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java
@@ -35,8 +35,6 @@ import org.eclipse.core.runtime.Platform;
*/
public class CommandLauncherManager {
- public final static String CONTAINER_BUILD_ENABLED = "container.build.enabled"; //$NON-NLS-1$
-
private static CommandLauncherManager instance;
private List<ICommandLauncherFactory> factories = new ArrayList<>();
@@ -195,6 +193,7 @@ public class CommandLauncherManager {
*
* @param config - ICBuildConfiguration to determine launcher for.
* @return an ICommandLauncher for running commands
+ * @since 6.5
*/
public ICommandLauncher getCommandLauncher(ICBuildConfiguration config) {
// loop through list of factories and return launcher returned with
@@ -202,10 +201,12 @@ public class CommandLauncherManager {
int highestPriority = -1;
ICommandLauncher bestLauncher = null;
for (ICommandLauncherFactory factory : factories) {
- ICommandLauncher launcher = factory.getCommandLauncher(config);
- if (launcher != null) {
- if (priorityMapping.get(factory) > highestPriority) {
- bestLauncher = launcher;
+ if (factory instanceof ICommandLauncherFactory2) {
+ ICommandLauncher launcher = ((ICommandLauncherFactory2)factory).getCommandLauncher(config);
+ if (launcher != null) {
+ if (priorityMapping.get(factory) > highestPriority) {
+ bestLauncher = launcher;
+ }
}
}
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory.java
index 7ab4429e920..8ac7cdbb96c 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory.java
@@ -37,15 +37,6 @@ public interface ICommandLauncherFactory {
public ICommandLauncher getCommandLauncher(ICConfigurationDescription cfgd);
/**
- * Get a Command Launcher for a build configuration descriptor
- * @param cfg - ICBuildConfiguration to get command launcher for
- * @return ICommandLauncher or null
- */
- public default ICommandLauncher getCommandLauncher(ICBuildConfiguration cfg) {
- return null;
- }
-
- /**
* Register language setting entries for a project
* @param project - IProject used in obtaining language setting entries
* @param entries - List of language setting entries
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory2.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory2.java
new file mode 100644
index 00000000000..5b838e4e1c8
--- /dev/null
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICommandLauncherFactory2.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat Inc. 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
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.core;
+
+import org.eclipse.cdt.core.build.ICBuildConfiguration;
+
+/**
+ * @since 6.5
+ */
+public interface ICommandLauncherFactory2 {
+
+ public static final String CONTAINER_BUILD_ENABLED = "container.build.enabled"; //$NON-NLS-1$
+
+ /**
+ * Get a Command Launcher for a build configuration descriptor
+ * @param cfg - ICBuildConfiguration to get command launcher for
+ * @return ICommandLauncher or null
+ */
+ public default ICommandLauncher getCommandLauncher(ICBuildConfiguration cfg) {
+ return null;
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildCommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildCommandLauncher.java
index 8171fb9c0b8..2abaa206631 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildCommandLauncher.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/ICBuildCommandLauncher.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.core.build;
+/**
+ * @since 6.5
+ */
public interface ICBuildCommandLauncher {
/**

Back to the top