|
25 | 25 | import java.util.Optional;
|
26 | 26 |
|
27 | 27 | import org.eclipse.core.resources.IResource;
|
| 28 | +import org.eclipse.core.resources.ResourcesPlugin; |
28 | 29 | import org.eclipse.core.runtime.CoreException;
|
29 | 30 | import org.eclipse.core.runtime.IPath;
|
30 | 31 | import org.eclipse.core.runtime.NullProgressMonitor;
|
| 32 | +import org.eclipse.core.runtime.OperationCanceledException; |
31 | 33 | import org.eclipse.core.runtime.Path;
|
32 | 34 | import org.eclipse.core.runtime.Platform;
|
| 35 | +import org.eclipse.core.runtime.jobs.Job; |
33 | 36 | import org.eclipse.debug.core.DebugEvent;
|
34 | 37 | import org.eclipse.debug.core.ILaunch;
|
35 | 38 | import org.eclipse.debug.core.ILaunchConfiguration;
|
36 | 39 | import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
37 | 40 | import org.eclipse.debug.core.model.IProcess;
|
| 41 | +import org.eclipse.debug.internal.ui.views.console.ProcessConsole; |
38 | 42 | import org.eclipse.jdt.core.IClasspathEntry;
|
39 | 43 | import org.eclipse.jdt.core.IJavaProject;
|
40 | 44 | import org.eclipse.jdt.core.JavaCore;
|
|
43 | 47 | import org.eclipse.jdt.debug.testplugin.DebugEventWaiter;
|
44 | 48 | import org.eclipse.jdt.debug.testplugin.JavaProjectHelper;
|
45 | 49 | import org.eclipse.jdt.debug.tests.AbstractDebugTest;
|
| 50 | +import org.eclipse.jdt.debug.tests.TestUtil; |
46 | 51 | import org.eclipse.jdt.internal.launching.LaunchingPlugin;
|
47 | 52 | import org.eclipse.jdt.launching.AbstractVMInstall;
|
48 | 53 | import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
|
@@ -242,6 +247,22 @@ protected void setLongClasspath(IJavaProject javaProject, int minClassPathLength
|
242 | 247 | javaProject.setRawClasspath(classpathEntries.toArray(new IClasspathEntry[classpathEntries.size()]), null);
|
243 | 248 | }
|
244 | 249 |
|
| 250 | + public static void waitForBuild() { |
| 251 | + boolean wasInterrupted = false; |
| 252 | + do { |
| 253 | + try { |
| 254 | + Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); |
| 255 | + Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null); |
| 256 | + TestUtil.waitForJobs("waitForBuild", 100, 105000, ProcessConsole.class); |
| 257 | + wasInterrupted = false; |
| 258 | + } catch (OperationCanceledException e) { |
| 259 | + e.printStackTrace(); |
| 260 | + } catch (InterruptedException e) { |
| 261 | + wasInterrupted = true; |
| 262 | + } |
| 263 | + } while (wasInterrupted); |
| 264 | + } |
| 265 | + |
245 | 266 | /**
|
246 | 267 | * Increased timeout
|
247 | 268 | *
|
|
0 commit comments