Builders create or modify workspace resources,
usually based on the existence and state of other resources. They are a powerful
mechanism for enforcing the constraints of some domain. For example, a Java
builder converts Java source files (.java files) into executable class files
(.class files), a web link builder updates links to files whose name/location
have changed, etc. As resources are created and modified, builders are run
and the constraints are maintained. This transform need not be one to one. For
example, a single .java file can produce several .class files.
Auto-build vs. Manual Build
There are two distinct user work modes with respect to
building: relying on Auto-build, or user initiated manual building.
If you don't need fine-grained control over when builds occur,
you can turn on auto-building. With auto-building on,
builds occur after every set of resource changes (e.g., saving a file, importing
a ZIP, ...). Auto-building is efficient because the amount of work done is
proportional to the amount of change done. The benefit of auto-building is
that your derived resources (e.g., Java .class files) are always up to date.
Auto-building is turned on/off via the Build automatically option on the
General > Workspace
If you need more control over when builds occur, you can turn off
auto-building and invoke builds manually. This is sometimes desirable in
cases where, for example, you know building is of no value until you finish a
large set of changes. In this case there is no benefit to paying the cost of
auto-building. Builds can be invoked manually in numerous ways, for example, by
right-clicking the project and selecting Build Project.
The disadvantage of manual building is that the problems that
were generated to indicate build errors quickly become out of date until you
build. In addition, it is very important that you remember to manually build
before relying on build output (e.g. before running your Java program).
Building and Cleaning
Builds work incrementally based on a previous built state. They
will apply the transforms of the configured builders only on the resources that have
changed since that previous state was computed (i.e., since the last build).
Auto-building always uses incremental building for efficiency.
A clean build (Project > Clean) discards any existing
built state. The next build after a clean will transform all resources according the
domain rules of the configured builders.
Depending on your needs, build and clean can
be done over a specific set of projects or the workspace as a whole. Specific
files and folders cannot be built separately.