Executing project builders
The whole point of project builders is that you don't need to
explicitly tell them to run. Instead, they run automatically whenever a qualifying build takes place
for the project that owns the buildfile. Remember that the builders are triggered as indicated
on the Build Options tab in the External Tools dialog and can be
any combination of after a clean, during a manual build or during auto builds. Let's see how this works.
- Select the HW project in one of the navigation views. In the workbench menu
bar, choose Project > Clean... Select Clean selected projects
and click Ok
- The project is rebuilt and the projectBuilder.xml buildfile is run. Notice
the output from this buildfile in the Console view.
- Make sure the Autobuild preference is turned on, then make some trivial
change to HelloWorld.java and save the change. The save triggers an auto build,
but the auto build does not trigger the project builder.
- Suppose we don't want to see the buildfile output every time it runs. Go
back to the External Tools Builders page of the project properties dialog
on HW. Select the Makejar entry and click Edit.... On the Main
tab, uncheck the Capture Output option, apply the change and exit back
to the workbench.
This concludes our look at Ant buildfiles as project builders
in Eclipse. It's worth repeating that though this example used a Java project,
project builders are not tied to Java, and may be used for any type of project.