public abstract class CompilationParticipant extends Object
Code that participates in the build should in general be implemented with a separate Builder, rather than a CompilationParticipant. It is only necessary to use a CompilationParticipant if the build step needs to interact with the Java build, for instance by creating additional Java source files that must themselves in turn be compiled.
Clients wishing to participate in the compilation process must subclass this class, and implement
isActive(IJavaProject)
, aboutToBuild(IJavaProject)
,
reconcile(ReconcileContext)
, etc.
This class is intended to be subclassed by clients.
Modifier and Type | Field and Description |
---|---|
static int |
NEEDS_FULL_BUILD |
static int |
READY_FOR_BUILD |
Constructor and Description |
---|
CompilationParticipant() |
Modifier and Type | Method and Description |
---|---|
int |
aboutToBuild(IJavaProject project)
Notifies this participant that a build is about to start and provides it the opportunity to
create missing source folders for generated source files.
|
void |
buildFinished(IJavaProject project)
Notifies this participant that a build has finished for the project.
|
void |
buildStarting(BuildContext[] files,
boolean isBatch)
Notifies this participant that a compile operation is about to start and provides it the opportunity to
generate source files based on the source files about to be compiled.
|
void |
cleanStarting(IJavaProject project)
Notifies this participant that a clean is about to start and provides it the opportunity to
delete generated source files.
|
boolean |
isActive(IJavaProject project)
Returns whether this participant is active for a given project.
|
boolean |
isAnnotationProcessor()
Returns whether this participant is interested in only Annotations.
|
void |
processAnnotations(BuildContext[] files)
Notifies this participant that a compile operation has found source files using Annotations.
|
void |
reconcile(ReconcileContext context)
Notifies this participant that a reconcile operation is happening.
|
public static final int READY_FOR_BUILD
public static final int NEEDS_FULL_BUILD
public int aboutToBuild(IJavaProject project)
Default is to return READY_FOR_BUILD
.
project
- the project about to buildbuildFinished(IJavaProject project)
public void buildFinished(IJavaProject project)
project
- the project about to buildpublic void buildStarting(BuildContext[] files, boolean isBatch)
files
- is an array of BuildContextisBatch
- identifies when the build is a batch buildpublic void cleanStarting(IJavaProject project)
project
- the project about to be cleanedpublic boolean isActive(IJavaProject project)
Default is to return false
.
For efficiency, participants that are not interested in the
given project should return false
for that project.
project
- the project to participate inpublic boolean isAnnotationProcessor()
Default is to return false
.
public void processAnnotations(BuildContext[] files)
files
- is an array of BuildContextpublic void reconcile(ReconcileContext context)
Note that a participant should not modify the buffer of the working copy that is being reconciled.
Default is to do nothing.
context
- the reconcile context to act on
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.