Created
October 23, 2012 06:53
-
-
Save yangboz/6730172507a5c8dea0f3 to your computer and use it in GitHub Desktop.
Ant xml example for JAVA code CPD.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project name="XXX Application Build with CPD" default="run" | |
basedir="../"> | |
<description> | |
Ant build sample for running | |
- CPD, | |
</description> | |
<!-- Change the paths to your individual installation directories --> | |
<property name="cpd.home.dir" location="${basedir}/tools/cpd/" /> | |
<property name="lib.dir" location="${basedir}/map/lib" /> | |
<property name="src.dir" location="${basedir}/map/app/" /> | |
<property name="bin.dir" location="${basedir}/bin" /> | |
<property name="htm.dir" location="${basedir}/html" /> | |
<property name="report.dir" location="${basedir}/report" /> | |
<property name="report.cpd.dir" location="${report.dir}/cpd" /> | |
<!-- Task of clean --> | |
<target name="clean" description="Delete all result to start with a clean build."> | |
<delete dir="${report.cpd.dir}" /> | |
<delete dir="${report.temp.dir}" /> | |
<delete dir="${bin.dir}" /> | |
</target> | |
<!-- Task of prepare report --> | |
<target name="prepare.report.dir" description="Prepares the reports folder"> | |
<mkdir dir="${report.cpd.dir}" /> | |
</target> | |
<!-- --> | |
<path id="cpd.classpath"> | |
<pathelement location="${build}" /> | |
<fileset dir="${cpd.home.dir}/lib/"> | |
<include name="*.jar" /> | |
</fileset> | |
</path> | |
<!-- Task of CPD --> | |
<target name="cpd"> | |
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" | |
classpathref="cpd.classpath" /> | |
<cpd minimumTokenCount="100" format="xml" language="java" | |
ignoreIdentifiers="true" ignoreLiterals="true" | |
outputFile="${report.cpd.dir}/cpd_report.xml"> | |
<fileset dir="${src.dir}"> | |
<include name="**/*.java" /> | |
</fileset> | |
</cpd> | |
</target> | |
<!-- --> | |
<target name="run" description="Run the build" depends="clean,prepare.report.dir,cpd"> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment