Skip to main content
summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorJeff Johnston2014-04-01 17:22:28 -0400
committerJeff Johnston2014-04-16 16:04:26 -0400
commitfdba4b05b8fd7967ecac7e1a6b2f25ef31cae5c1 (patch)
tree4e07c182518a90681af5386ff26db93c78340a46 /remote
parent4381cc5da1c1a91c603ce956c8737947170cc3e9 (diff)
downloadorg.eclipse.cdt-fdba4b05b8fd7967ecac7e1a6b2f25ef31cae5c1.tar.gz
org.eclipse.cdt-fdba4b05b8fd7967ecac7e1a6b2f25ef31cae5c1.tar.xz
org.eclipse.cdt-fdba4b05b8fd7967ecac7e1a6b2f25ef31cae5c1.zip
Bug 430831 - add autotools support for PTP synchronized project
- bump up minor version - refresh remote synchronized projects when adding a file or directory - for remote synchronized projects, use remote interfaces to figure out target OS - look for synchronized builder when adding Autotools builder - switch to use RemoteCommandLauncher in autotools core and ui - make autotools.core and autotools.ui friends of CDT remote.core - fix org.eclipse.cdt.remote.core to respect working directory - wait for process exitValue to succeed in try loop before attempting to use the return value Change-Id: I837ecf74c44085e35b7e775250b7e5264051475e Reviewed-on: https://git.eclipse.org/r/24360 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
Diffstat (limited to 'remote')
-rw-r--r--remote/org.eclipse.cdt.remote.core/META-INF/MANIFEST.MF5
-rw-r--r--remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/core/RemoteCommandLauncher.java15
2 files changed, 18 insertions, 2 deletions
diff --git a/remote/org.eclipse.cdt.remote.core/META-INF/MANIFEST.MF b/remote/org.eclipse.cdt.remote.core/META-INF/MANIFEST.MF
index 6576b05846..b13e1a5ea8 100644
--- a/remote/org.eclipse.cdt.remote.core/META-INF/MANIFEST.MF
+++ b/remote/org.eclipse.cdt.remote.core/META-INF/MANIFEST.MF
@@ -6,9 +6,10 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.remote.internal.core.Activator
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.core,
- org.eclipse.remote.core
+ org.eclipse.remote.core,
+ org.eclipse.core.filesystem
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %pluginProvider
Import-Package: org.eclipse.core.resources
-Export-Package: org.eclipse.cdt.remote.core;x-internal:=true
+Export-Package: org.eclipse.cdt.remote.core;x-friends="org.eclipse.cdt.autotools.core,org.eclipse.cdt.autotools.ui"
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 aa090eb3c3..222d40f6d3 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
@@ -12,6 +12,7 @@ package org.eclipse.cdt.remote.core;
import java.io.IOException;
import java.io.OutputStream;
+import java.net.MalformedURLException;
import java.net.URI;
import java.util.Map;
import java.util.Properties;
@@ -19,10 +20,12 @@ import java.util.Properties;
import org.eclipse.cdt.core.CommandLauncher;
import org.eclipse.cdt.core.ICommandLauncher;
import org.eclipse.cdt.remote.internal.core.messages.Messages;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IProject;
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.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.core.IRemoteProcessBuilder;
@@ -68,6 +71,18 @@ public class RemoteCommandLauncher implements ICommandLauncher {
parseEnvironment(env);
fCommandArgs = constructCommandArray(commandPath.toOSString(), args);
IRemoteProcessBuilder processBuilder = fConnection.getProcessBuilder(fCommandArgs);
+ if (workingDirectory != null) {
+ IPath relativePath = workingDirectory.makeRelativeTo(getProject().getLocation());
+ try {
+ IPath remoteWorkingPath =
+ new Path(remRes.getActiveLocationURI().toURL().getPath()).append(relativePath);
+ IFileStore wd = fConnection.getFileManager().getResource(remoteWorkingPath.toString());
+ processBuilder.directory(wd);
+ } catch (MalformedURLException e) {
+ fLocalLauncher.setErrorMessage(e.getMessage());
+ return null;
+ }
+ }
Map<String, String> processEnv = processBuilder.environment();
for (String key : fEnvironment.stringPropertyNames()) {
processEnv.put(key, fEnvironment.getProperty(key));

Back to the top