Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2017-04-26 19:25:52 +0000
committerJeff Johnston2017-06-22 22:10:10 +0000
commit9a262a6cd4d4e656355191288df675cf831d8a7a (patch)
treec800dd65990d3454c7054e6e80aa3b2149fa8cc5
parent00a7db1c4d2c6c032114da567ef072a80ef8188f (diff)
downloadorg.eclipse.cdt-9a262a6cd4d4e656355191288df675cf831d8a7a.tar.gz
org.eclipse.cdt-9a262a6cd4d4e656355191288df675cf831d8a7a.tar.xz
org.eclipse.cdt-9a262a6cd4d4e656355191288df675cf831d8a7a.zip
Refactor CommandLauncherFactoryManager to CommandLauncherManager
-rw-r--r--build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java4
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java13
-rw-r--r--codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/externaltool/ExternalToolInvoker.java4
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java6
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java (renamed from core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherFactoryManager.java)15
-rw-r--r--remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java6
10 files changed, 37 insertions, 27 deletions
diff --git a/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java b/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
index e2df9dc56b..8cbe618ac7 100644
--- a/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
+++ b/build/org.eclipse.cdt.autotools.tests/src/org/eclipse/cdt/autotools/tests/ProjectTools.java
@@ -18,7 +18,7 @@ import java.util.zip.ZipFile;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CommandLauncher;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
@@ -131,7 +131,7 @@ public class ProjectTools {
*/
public static boolean markExecutable(IProject project, String filePath) {
// Get a launcher for the config command
- ICommandLauncher launcher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
launcher.setProject(project);
OutputStream stdout = new ByteArrayOutputStream();
OutputStream stderr = new ByteArrayOutputStream();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
index cffa0635fe..50a9e61e5e 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeBuilder.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -180,7 +180,7 @@ public class MakeBuilder extends ACBuilder {
console.start(project);
// Prepare launch parameters for BuildRunnerHelper
- ICommandLauncher launcher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
String[] targets = getTargets(kind, info);
if (targets.length != 0 && targets[targets.length - 1].equals(info.getCleanBuildTarget()))
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
index 787d23f48e..8a2c47fab1 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java
@@ -19,7 +19,7 @@ import java.util.List;
import java.util.Properties;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -120,7 +120,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider {
}
console.start(project);
- ICommandLauncher launcher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
launcher.setProject(project);
IPath program = getCommandToLaunch();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
index bc924ce04d..9f7c979b64 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/CommandBuilder.java
@@ -18,7 +18,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
@@ -147,7 +147,7 @@ public class CommandBuilder implements IBuildModelBuilder {
}
protected ICommandLauncher createLauncher() {
- return CommandLauncherFactoryManager.getInstance().getCommandLauncher(fProject);
+ return CommandLauncherManager.getInstance().getCommandLauncher(fProject);
}
public String getErrMsg() {
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 914a6f1e92..aa3427dce5 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
@@ -25,7 +25,7 @@ import java.util.SortedMap;
import java.util.StringTokenizer;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
@@ -2858,7 +2858,7 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
return getSuperClass().getCommandLauncher();
else if(fCommandLauncher == null) // catch all for backwards compatibility
- fCommandLauncher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ fCommandLauncher = CommandLauncherManager.getInstance().getCommandLauncher();
return fCommandLauncher;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
index b4f98d12a5..00e17865bf 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractBuiltinSpecsDetector.java
@@ -26,7 +26,7 @@ import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ErrorParserManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
@@ -482,6 +482,8 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
return;
}
+ System.out.println("in execute");
+
WorkspaceJob job = new WorkspaceJob(ManagedMakeMessages.getResourceString("AbstractBuiltinSpecsDetector.DiscoverBuiltInSettingsJobName")) { //$NON-NLS-1$
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
@@ -532,6 +534,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
* @return status of operation.
*/
protected IStatus runForEachLanguage(IProgressMonitor monitor) {
+
+ System.out.println("in runForEachLanguage");
+
MultiStatus status = new MultiStatus(ManagedBuilderCorePlugin.PLUGIN_ID, IStatus.OK, "Problem running CDT Scanner Discovery provider " + getId(), null); //$NON-NLS-1$
if (monitor == null) {
@@ -638,6 +643,9 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
* has not been called yet.
*/
private void runForLanguage(IProgressMonitor monitor) throws CoreException {
+
+ System.out.println("run for language");
+
buildRunnerHelper = new BuildRunnerHelper(currentProject);
if (monitor == null) {
@@ -656,7 +664,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
console.start(currentProject);
- ICommandLauncher launcher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
launcher.setProject(currentProject);
IPath program = new Path(""); //$NON-NLS-1$
@@ -756,6 +764,7 @@ public abstract class AbstractBuiltinSpecsDetector extends AbstractLanguageSetti
}
protected int runProgramForLanguage(String languageId, String command, String[] envp, URI workingDirectoryURI, OutputStream consoleOut, OutputStream consoleErr, IProgressMonitor monitor) throws CoreException, IOException {
+ System.out.println("runProgramForLanguage");
return buildRunnerHelper.build(monitor);
}
diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/externaltool/ExternalToolInvoker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/externaltool/ExternalToolInvoker.java
index ba3de1969c..4e02aa476f 100644
--- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/externaltool/ExternalToolInvoker.java
+++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/internal/externaltool/ExternalToolInvoker.java
@@ -18,7 +18,7 @@ import org.eclipse.cdt.codan.core.cxx.externaltool.ConfigurationSettings;
import org.eclipse.cdt.codan.core.cxx.externaltool.InvocationFailure;
import org.eclipse.cdt.codan.core.cxx.externaltool.InvocationParameters;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.core.IConsoleParser;
import org.eclipse.cdt.core.resources.IConsole;
@@ -85,7 +85,7 @@ public class ExternalToolInvoker {
final OutputStream out = sniffer.getOutputStream();
final OutputStream err = sniffer.getErrorStream();
try {
- ICommandLauncher launcher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher();
launcher.showCommand(true);
launcher.setProject(project);
Process p = launcher.execute(commandPath, commandArgs, commandEnv, workingDirectory, new SubProgressMonitor(monitor, 50));
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java
index b3b2c7de9b..2f2999f8e1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/language/settings/providers/LanguageSettingsSerializableProvider.java
@@ -17,7 +17,7 @@ import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.internal.core.XmlUtil;
@@ -147,7 +147,7 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr
List<? extends ICLanguageSettingEntry> entries) {
String rcProjectPath = rc!=null ? rc.getProjectRelativePath().toString() : null;
fStorage.setSettingEntries(rcProjectPath, languageId, entries);
- CommandLauncherFactoryManager.getInstance().setLanguageSettingEntries(cfgDescription.getProjectDescription().getProject(), entries);
+ CommandLauncherManager.getInstance().setLanguageSettingEntries(cfgDescription.getProjectDescription().getProject(), entries);
}
/**
@@ -171,7 +171,7 @@ public class LanguageSettingsSerializableProvider extends LanguageSettingsBasePr
}
if (cfgDescription != null) {
- entries = CommandLauncherFactoryManager.getInstance().getLanguageSettingEntries(cfgDescription.getProjectDescription().getProject(), entries);
+ entries = CommandLauncherManager.getInstance().getLanguageSettingEntries(cfgDescription.getProjectDescription().getProject(), entries);
}
return entries;
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherFactoryManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java
index a57f929a6d..1e6084a78e 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherFactoryManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncherManager.java
@@ -29,19 +29,19 @@ import org.eclipse.core.runtime.Platform;
/**
* @since 6.3
*/
-public class CommandLauncherFactoryManager {
+public class CommandLauncherManager {
- private static CommandLauncherFactoryManager instance;
+ private static CommandLauncherManager instance;
private List<ICommandLauncherFactory> factories = new ArrayList<>();
- private CommandLauncherFactoryManager() {
+ private CommandLauncherManager() {
loadCommandLauncherFactoryExtensions();
}
- public static synchronized CommandLauncherFactoryManager getInstance() {
+ public static synchronized CommandLauncherManager getInstance() {
if (instance == null) {
- instance = new CommandLauncherFactoryManager();
+ instance = new CommandLauncherManager();
}
return instance;
}
@@ -57,9 +57,9 @@ public class CommandLauncherFactoryManager {
private IProject fProject;
private boolean fShowCommand;
private String fErrorMessage;
- private CommandLauncherFactoryManager manager;
+ private CommandLauncherManager manager;
- public CommandLauncherWrapper(CommandLauncherFactoryManager manager) {
+ public CommandLauncherWrapper(CommandLauncherManager manager) {
this.manager = manager;
}
@@ -142,6 +142,7 @@ public class CommandLauncherFactoryManager {
return launcher.execute(commandPath, args, env, workingDirectory, monitor);
}
+ @SuppressWarnings("deprecation")
@Override
public int waitAndRead(OutputStream out, OutputStream err) {
if (launcher != null) {
diff --git a/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java b/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java
index cfe9c89057..da2ee6f03f 100644
--- a/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java
+++ b/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java
@@ -17,7 +17,7 @@ import java.net.URI;
import java.util.Map;
import java.util.Properties;
-import org.eclipse.cdt.core.CommandLauncherFactoryManager;
+import org.eclipse.cdt.core.CommandLauncherManager;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.remote.internal.core.Activator;
import org.eclipse.cdt.remote.internal.core.messages.Messages;
@@ -104,7 +104,7 @@ public class RemoteCommandLauncher implements ICommandLauncher {
return s;
}
- private ICommandLauncher fLocalLauncher = CommandLauncherFactoryManager.getInstance().getCommandLauncher();
+ private ICommandLauncher fLocalLauncher = CommandLauncherManager.getInstance().getCommandLauncher();
private boolean fShowCommand;
private String[] fCommandArgs;
private IRemoteConnection fConnection;
@@ -131,7 +131,7 @@ public class RemoteCommandLauncher implements ICommandLauncher {
@Override
public Process execute(IPath commandPath, String[] args, String[] env, IPath workingDirectory, IProgressMonitor monitor)
throws CoreException {
- ICommandLauncher localLauncher = CommandLauncherFactoryManager.getInstance().getCommandLauncher(getProject());
+ ICommandLauncher localLauncher = CommandLauncherManager.getInstance().getCommandLauncher(getProject());
localLauncher.setProject(getProject());
localLauncher.setErrorMessage(getErrorMessage());
usingLocalLauncher = false;

Back to the top