Le 05/02/2010 08:33, Scott Gray a écrit :
On 4/02/2010, at 11:41 PM, Adam Heath wrote:
I'll also be looking for java code formatting tools; anyone have any
suggestions that are apache compatible(has to be free, won't use
commercial things at all(don't get me started on confluence)).
PMD (http://pmd.sourceforge.net/) uses a BSD style license and may be worth a
look.
Regards
Scott
I have already the PMD task done, just add those lines in the build.xml
file, and add the relevant libraries in framework/base/lib
<path id="cq.classpath">
<pathelement location="."/>
<fileset dir="framework/base/lib/">
<include name="*.jar"/>
</fileset>
</path>
<target name="pmd">
<taskdef name="pmd"
classname="net.sourceforge.pmd.ant.PMDTask" classpathref="cq.classpath"/>
<pmd shortFilenames="true" rulesetfiles="basic">
<formatter type="xml" toFile="runtime/pmd.xml" />
<fileset dir="." includes="**/*.java" />
</pmd>
</target>
You can also use checkstyle, which will compare code to rules
(http://checkstyle.sourceforge.net)
--
Erwan de FERRIERES
www.nereide.biz