Skip to content

Commit

Permalink
reallyWaitForAutoBuild after build
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jan 20, 2025
1 parent 24c10f8 commit bdc0d9b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,21 @@ public static void waitForAutoBuild() {
reallyWaitForAutoBuild();
}


public static void reallyWaitForAutoBuild() {
reallyWaitForAutoBuild(new ConsoleLoggingProgressMonitor("AUTOBUILD"));
}

/**
* A test that really should test the mechanism including the delay
* after the resource change event, could wait for the auto build.
*/
public static void reallyWaitForAutoBuild() {
public static void reallyWaitForAutoBuild(IProgressMonitor monitor) {
boolean wasInterrupted = false;
do {
try {
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD,
null);
monitor);
wasInterrupted = false;
} catch (OperationCanceledException e) {
e.printStackTrace();
Expand Down Expand Up @@ -408,6 +413,7 @@ public static void waitForBuild(IProgressMonitor monitor) {
try {
waitForJdtIndex();
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
reallyWaitForAutoBuild(new ConsoleLoggingProgressMonitor("AFTER BUILD"));
} catch (CoreException e) {
OperationCanceledException operationCanceledException = new OperationCanceledException(e.getMessage());
operationCanceledException.addSuppressed(e);
Expand Down

0 comments on commit bdc0d9b

Please sign in to comment.