Ant task code review

If you use the Apache Ant build tool to build plug-ins in the Eclipse plug-in development environment (PDE), you can include code reviews in your build process.

The analysis feature includes an Ant task called analysis.analyze that you can add to a build file in a plug-in development project. This enables you to run code reviews as a PDE project builds and lets you perform the tasks of building and testing the quality of your code in a single step.

The analysis.analyze task takes up to three attributes that specify the projects that contain the Java™ source code to analyze, the rules to apply, and the location of the analysis results.

Ant task example

The following example shows an Ant task that is part of a PDE project's build.xml file. When the hello.world project builds, the task runs a code review on the source code. The task applies the code review rules it finds in a rule file located in c:\rules and writes the results of the review to XML and HTML files in c:\results.
<target name="code review">
  <analysis.analyze
    ruleFile="c:/rules/commlinecoderev.dat"
    projects="hello.world"
    exportdirectory="c:/results" />
</target>
Related tasks
Running a code review as an Ant task