The Eclipse build order

The build order is an Eclipse concept, as opposed to the build path, which EGL maintains.

Eclipse maintains a build order for projects that share code (such as record definitions), share variables, or call each other's programs.

A key concept here is project cycles. A project cycle involves two or more projects with mutual dependencies. For example, assume that Project1 contains parts A and C, and Project2 contains parts B and D. A depends on B, B depends on C, and C depends on D. If EGL builds Project1 first, it finds errors in parts A and C because it cannot resolve references to parts B and D. After building Project2, which produces no errors because A and C have already been built in Project1, EGL builds Project1 again to resolve the errors in A and C.

Eclipse determines the build order by asking each project for its dependencies, which EGL generates using the .eglpath file (see The EGL build path). If the workspace contains no cycles, the order that Eclipse determines is the most efficient, and allows EGL to build all the projects in a single pass.

However, Eclipse does not take project cycles into account. If there are project cycles in the workspace, EGL may be able to modify the build order to improve workspace build times. When you click Project > Optimize EGL Project Build Order, EGL attempts to move projects that are involved in cycles to a more optimal spot in the build order.

You can manually change the build order through the workspace preferences (Window > Preferences > General > Workspace > Build Order). Changing these preferences manually may cause build errors. You can also use the Build Order preference page to revert changes introduced in the build order by the optimization operation.

You can change the Max iterations when building with cycles field on the Build Order preferences page. The value of this field limits the number of times the build will cycle through the projects. If this value is too low, the build may terminate before resolving all errors.


Feedback