Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorMoritz 'Morty' Strübe2020-09-06 13:50:07 -0400
committerMoritz 'Morty' Strübe2020-09-06 13:50:34 -0400
commit10e74dda5225ac378729ceaaaf02c2f5341343db (patch)
tree77dfb08362392d627c99620d62a93510a10fbb50 /launch
parent17b3e6c1a676c036de973c325817f07de063a0a5 (diff)
downloadorg.eclipse.cdt-10e74dda5225ac378729ceaaaf02c2f5341343db.tar.gz
org.eclipse.cdt-10e74dda5225ac378729ceaaaf02c2f5341343db.tar.xz
org.eclipse.cdt-10e74dda5225ac378729ceaaaf02c2f5341343db.zip
Bug 566710 Copy CIncludeFileEntrys from Docker image
Also copy files included using "-include", by copying and adjusting ICIncludeFileEntry, entries. Change-Id: I886b87a39b3cd6a7b2ea59aeaef327ca9bc69e45
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
index 28359b5d233..23579188a1a 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
@@ -27,8 +27,10 @@ import org.eclipse.cdt.core.ICommandLauncherFactory2;
import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICIncludeFileEntry;
import org.eclipse.cdt.core.settings.model.ICIncludePathEntry;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
@@ -41,6 +43,7 @@ import org.eclipse.cdt.managedbuilder.internal.dataprovider.BuildConfigurationDa
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.linuxtools.docker.ui.launch.ContainerLauncher;
@@ -163,6 +166,9 @@ public class ContainerCommandLauncherFactory implements ICommandLauncherFactory,
for (ICLanguageSettingEntry entry : entries) {
if (entry instanceof ICIncludePathEntry) {
paths.add(entry.getValue());
+ } else if (entry instanceof ICIncludeFileEntry) {
+ paths.add(new org.eclipse.core.runtime.Path(entry.getValue()).removeLastSegments(1)
+ .toString());
}
}
if (paths.size() > 0) {
@@ -374,12 +380,19 @@ public class ContainerCommandLauncherFactory implements ICommandLauncherFactory,
entry.getFlags());
newEntries.add(newEntry);
continue;
- } else {
- newEntries.add(entry);
}
- } else {
- newEntries.add(entry);
}
+ if (entry instanceof ICIncludeFileEntry) {
+ IPath p = new Path(((ICIncludeFileEntry) entry).getName());
+ if (copiedVolumes.contains(p.removeLastSegments(1).toString())) {
+ IPath newPath = hostDir.append(entry.getName());
+ CIncludeFileEntry newEntry = new CIncludeFileEntry(newPath.toString(),
+ entry.getFlags());
+ newEntries.add(newEntry);
+ continue;
+ }
+ }
+ newEntries.add(entry);
}
return newEntries;
}

Back to the top