Running a code review as an Ant task
You can run a code review when you build an Eclipse plug-in in
the plug-in development environment (PDE) by adding an Apache Ant task to
the plug-in's build.xml file.
To run a code review from the command line, you must create a rules
The analysis.analyze Ant task provides a convenient method to run
a code review as part of a complete build process for plug-ins you develop
in the PDE. You can configure the PDE project builder to run the Ant task
whenever you build the project and whenever you clean the project and rebuild
To run a code review as an Ant task:
- Verify that the analysis.analyze Ant task is registered.
- In the Preferences window, click Ant,
then click Runtime.
- In the Runtime pane, click the Tasks tab
and verify that the analysis.analyze Ant task is listed in the Name column.
- If the plug-in project does not have an Ant build file, in the Package
Explorer view, right-click the project name; then click
- Open the build.xml file and add the following Ant target:
<target name="code review">
<analysis.analyze projects="project name"
rulefile="path to rules file" />
- Test the target: in the Outline view, right-click the target name
(for example, code review); then click The .Console view
displays the results of the code review.
- Create a builder for the Ant task.
- In the package Explorer view, cick the PDE project; then click
- In the Properties window, in the left pane,
click Builders; then click New.
- In the Choose configuration type window,
click Ant build; then click OK
- In the Properties for new builder window,
on the Main page, click Browse Workspace
- In the Choose Location window, click the
name of a PDE project; then click build.xml, and click OK.
- On the Targets page,
for the After a "Clean" setting, click Set Targets.
- In the Set Targets window,
clear the build.jars setting
- Repeat substep 5.f and
substep 5.g for the Manual
- In the Properties for new builder window, type a name for the
builder (for example, code review), and click OK.
- In the PDE perspective, click .
The results of the code review display in the Console view.