Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2017-05-02 20:19:26 +0000
committerRoland Grunberg2017-06-08 18:57:30 +0000
commiteb8cc05b8922cad30fe774b4e5e015c968de021b (patch)
tree9054bd9045a121ea5664cd112b832f222d5f6048
parent919c0fc9b26aac49ffe0b1a1327733b7177baa1f (diff)
downloadorg.eclipse.linuxtools-eb8cc05b8922cad30fe774b4e5e015c968de021b.tar.gz
org.eclipse.linuxtools-eb8cc05b8922cad30fe774b4e5e015c968de021b.tar.xz
org.eclipse.linuxtools-eb8cc05b8922cad30fe774b4e5e015c968de021b.zip
Use the Docker Tooling to run the command in the container.
Change-Id: I4b6f58d0b0f6a0155455b5e592d97cfa9c2d9846 Reviewed-on: https://git.eclipse.org/r/98933 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF4
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ContainerVMRunner.java15
2 files changed, 15 insertions, 4 deletions
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF b/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
index ef81ea82a5..e3ee755b43 100644
--- a/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/META-INF/MANIFEST.MF
@@ -14,4 +14,6 @@ Require-Bundle: org.eclipse.debug.core,
org.eclipse.jdt.launching;bundle-version="3.9.0",
org.eclipse.jdt.core;bundle-version="3.13.0",
org.eclipse.jdt.debug.ui;bundle-version="3.8.0",
- org.eclipse.osgi
+ org.eclipse.osgi,
+ org.eclipse.linuxtools.docker.ui,
+ org.eclipse.linuxtools.docker.core
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ContainerVMRunner.java b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ContainerVMRunner.java
index f830c565ea..a074cdbeaa 100644
--- a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ContainerVMRunner.java
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ContainerVMRunner.java
@@ -16,6 +16,8 @@ import java.util.Arrays;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.internal.launching.StandardVMRunner;
import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.linuxtools.docker.core.DockerConnectionManager;
+import org.eclipse.linuxtools.docker.ui.launch.ContainerLauncher;
public class ContainerVMRunner extends StandardVMRunner {
@@ -24,12 +26,19 @@ public class ContainerVMRunner extends StandardVMRunner {
}
protected Process exec(String[] cmdLine, File workingDirectory) throws CoreException {
- System.out.println("Ran : " + String.join(" ", cmdLine) + " in " + workingDirectory.getAbsolutePath());
- return null;
+ return exec(cmdLine, workingDirectory, null);
}
protected Process exec(String[] cmdLine, File workingDirectory, String[] envp) throws CoreException {
- System.out.println("Ran : " + String.join(" ", cmdLine) + " in " + workingDirectory.getAbsolutePath() + " with env.");
+ String connectionUri = DockerConnectionManager.getInstance().getFirstConnection().getUri();
+ String command = String.join(" ", cmdLine); //$NON-NLS-1$
+
+ ContainerLauncher launch = new ContainerLauncher();
+ launch.launch("org.eclipse.linuxtools.jdt.docker.launcher", null, connectionUri,
+ "fedora-java", command, null, workingDirectory.getAbsolutePath(), null,
+ System.getenv(), null,
+ null, false, true, true);
+
return null;
}
}

Back to the top