Bug 579082 - new API for IncrementalProjectBuilder for rebuilding

Added new requestProjectRebuild(boolean) and
requestProjectsRebuild(Collection<IProject>) API in
IncrementalProjectBuilder that allows builders that generate sources
relevant for the current project or to any given projects to trigger
extra rebuild round, so other builders on same project or other projects
build can be re-triggered in the current build job.

The default IncrementalProjectBuilder implementation uses new methods
requestRebuild(Collection<IProject>) and requestRebuild(IProject,
boolean) in BuildManager.

If requestProjectRebuild(boolean) is called by a builder during project
build, BuildManager will try to rebuild current project only. The
boolean flag allows builders to request immediate project rebuild (no
following builders will be run), or to do a rebuild after all configured
builders are done.

If requestProjectsRebuild(Collection<IProject>) is called by a
builder, BuildManager will try to rebuild given projects in the next
build cycle.

Additionally to that, a new system property allows to skip other
projects to be built and restart entire build loop from scratch, if a
rebuild was requested via needRebuild() or
requestRebuild(Collection<IProject>). This can be done by setting system
property
-Dorg.eclipse.core.resources.allowEarlyBuildLoopExit=true

Change-Id: Ibbe9181531a89ed6fc436e4bc26f6e0d0b7fb4bd
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/191538
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
10 files changed