From 60affd8b9f98c07b0dac9176964250b67029ef70 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 19 Mar 2018 18:12:54 -0400 Subject: Bug 532420 - Make Container Core Build indexing more efficient - add new ICBuildConfiguration2 to keep API checks happy - remove refreshScannerInfo method from ICBuildConfiguration and put it in ICBuildConfiguration2 - make CBuildConfiguration implement ICBuildConfiguration2 - update ContainerPropertyVolumesModel to use new Docker plug-ins using docker-client 8.9.2. - fix MesonBuildConfiguration to use a job for each compile line being processed, then wait until all jobs are done before causing an reindex to occur (this will maximize parallelism when building in Containers) - fix ContainerCommandLauncherFactory to save the project so we can exclude project directories when copying header files using the new Docker Tooling interfaces - fix CoreBuildLaunchBarTracker to use ICBuildConfiguration2 interface to make the call to refreshScannerInfo Change-Id: I2138f5111614e7821e46c22731397a01035eac0a --- .../launcher/ContainerCommandLauncherFactory.java | 18 ++++++++++++++++-- .../launcher/ui/launchbar/ContainerGCCToolChain.java | 2 -- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'launch/org.eclipse.cdt.docker.launcher') 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 369460f1588..0d2d472eef8 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 @@ -41,8 +41,11 @@ import org.eclipse.linuxtools.docker.ui.launch.ContainerLauncher; public class ContainerCommandLauncherFactory implements ICommandLauncherFactory, ICommandLauncherFactory2 { + private IProject project; + @Override public ICommandLauncher getCommandLauncher(IProject project) { + this.project = project; // check if container build enablement has been checked ICConfigurationDescription cfgd = CoreModel.getDefault() .getProjectDescription(project) @@ -80,6 +83,7 @@ public class ContainerCommandLauncherFactory if (cfg == null) { return null; } + this.project = (IProject) cfg.getManagedProject().getOwner(); IOptionalBuildProperties props = cfg.getOptionalBuildProperties(); if (props != null) { String enablementProperty = props.getProperty( @@ -99,6 +103,11 @@ public class ContainerCommandLauncherFactory @Override public ICommandLauncher getCommandLauncher(ICBuildConfiguration cfgd) { + try { + this.project = cfgd.getBuildConfiguration().getProject(); + } catch (CoreException e1) { + return null; + } // check if container linux os is set IToolChain toolchain; try { @@ -201,10 +210,12 @@ public class ContainerCommandLauncherFactory return; } IPath hostDir = pluginPath; + List excludeList = new ArrayList<>(); + excludeList.add(project.getLocation().toString()); @SuppressWarnings("unused") int status = launcher.fetchContainerDirs(connectionName, imageName, - paths, hostDir); + paths, excludeList, hostDir); } } } @@ -294,8 +305,11 @@ public class ContainerCommandLauncherFactory return includePaths; } IPath hostDir = pluginPath; + // exclude project directories from any copying operation + List excludeList = new ArrayList<>(); + excludeList.add(project.getLocation().toString()); int status = launcher.fetchContainerDirsSync(connectionName, - imageName, includePaths, hostDir); + imageName, includePaths, excludeList, hostDir); if (status == 0) { Set copiedVolumes = launcher .getCopiedVolumes(connectionName, imageName); diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java index ae828a9fd0b..c773a3204c0 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java @@ -383,8 +383,6 @@ public class ContainerGCCToolChain extends PlatformObject implements IToolChain return null; } - // process.waitFor(); - // Scan for the scanner info Map symbols = new HashMap<>(); List includePath = new ArrayList<>(); -- cgit v1.2.3