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.

  1. 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
  2. The project is rebuilt and the projectBuilder.xml buildfile is run. Notice the output from this buildfile in the Console view.
  3. 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.
  4. 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, un-check 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.

Creating Ant buildfiles
Editing Ant buildfiles
Saving & Reusing Ant options
Running Ant buildfiles
Creating a project builder Ant buildfile
Project Builder Ant Targets
Ant buildfiles as project builders
External tools
Non-Ant project builders
Stand-alone external tools