The final part of the puzzle is to implement the incremental part of the builder. Most of the builds that Eclipse performs are incremental, which means that it only compiles the files that are needed at each point. An incremental build gives a resource delta which says what files have been modified, added, or removed. This is implemented in IResourceDelta
which is handed to the IResourceDeltaVisitor
visit()
method. A resource delta combines an IResource
with a flag that says whether it was added or removed. Perform the following steps:
Open
MinimarkBuilder
and go to thevisit(IResourceDelta)
method. This is used by the incremental build when individual files are changed. Since the delta already has a resource, it can be used to determine if the file is relevant, and if so pass it to theprocessResource()
method:public boolean visit(IResourceDelta delta) throws CoreException { IResource resource = delta.getResource(); if(resource.getName...