[Appsunit-develop] [cvscommit] project build.xml,1.2,1.3
Status: Beta
Brought to you by:
jancumps
From: Jan C. <jan...@us...> - 2006-09-23 20:27:07
|
Update of /cvsroot/appsunit/project In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv30878 Modified Files: build.xml Log Message: First succssful build, working checkstyle and PDM. Index: build.xml =================================================================== RCS file: /cvsroot/appsunit/project/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 8 Sep 2006 15:09:24 -0000 1.2 --- build.xml 23 Sep 2006 20:27:04 -0000 1.3 *************** *** 1 **** ! <?xml version="1.0"?> <!-- $Header$ $Revision$ $Date$ --> <project name="Apps Unit" basedir="." default="all"> <!-- Load local and user build preferences --> <property file="${user.home}/build.properties"/> <property file="build.properties"/> <!-- ========== Initialization Properties ================================= --> <property name="build.dir" value="build"/> <!-- ========== Derived Properties ======================================== --> <!-- where the zipped distros are stored --> <property name="dist.dir" value="${build.dir}/dist"/> <!-- working directories where the distros are prepared --> <property name="dist.source.dir" value="${build.dir}/source_distribution"/> <property name="dist.bin.dir" value="${build.dir}/bin_distribution"/> <property name="test.source.dir" value="tst"/> <property name="test.dir" value="${build.dir}/test"/> <property name="test.bin.dir" value="${test.dir}/bin"/> <property name="test.result.dir" value="${test.dir}/test_results"/> <property name="checkstyle.result.dir" value="${build.dir}/checkstyle"/> <property name="pmd.result.dir" value="${build.dir}/pmd"/> <!-- compilation Classpath --> <path id="compile.classpath"> <pathelement location="${junit.jar}"/> </path> <!-- Testing Classpath --> <path id="junit.classpath"> <pathelement location="${junit.jar}"/> <pathelement location="${test.bin.dir}"/> </path> <!-- ========== Executable Targets ======================================== --> <target name="clean" description="clean build structure"> <delete dir="${build.dir}"/> </target> <target name="init" description="initialise build structure"> <tstamp/> <!-- file where version numbers are defined --> <property file="version.properties"/> <mkdir dir="${build.dir}"/> </target> <target name="build" description="build project" depends="init, init-build"/> <target name="init-build"> <mkdir dir="${dist.dir}"/> </target> <target name="build-bin" depends="init-build"> <!-- create binary distribution --> <mkdir dir="${dist.bin.dir}"/> <copy todir="${dist.bin.dir}"> <fileset dir="${basedir}"> <include name="STATUS"/> <include name="README"/> <include name="cpl-v10.html"/> </fileset> </copy> <zip basedir="${dist.bin.dir}" zipfile="${dist.dir}/appsunit_${version}.zip" compress="true"/> </target> <target name="build-source" depends="init-build"> <!-- create source distribution --> <mkdir dir="${dist.source.dir}"/> <copy todir="${dist.source.dir}"> <fileset dir="${basedir}"> <include name="STATUS"/> <include name="README"/> <include name="build.properties.sample"/> <include name="build.xml"/> <include name="cpl-v10.html"/> <include name="src/**"/> <include name="tst/**"/> </fileset> </copy> <zip basedir="${dist.source.dir}" zipfile="${dist.dir}/antunit_source_${version}.zip" compress="true"> </zip> </target> <!-- unit test targets --> <!-- create javadoc for unittests --> <target name="javadoc" description="generate javadocs"> </target> <!-- compile unittests --> <target name="java-compile-tests" depends="init" description="Compile test java sources"> <delete dir="${test.bin.dir}"/> <mkdir dir="${test.bin.dir}"/> <javac srcdir="${test.source.dir}" destdir="${test.bin.dir}" debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}"> <exclude name="resources/**" /> <exclude name="**/package.html"/> <exclude name="**/overview.html"/> <classpath refid="compile.classpath"/> <!--compilerarg value="-Xlint:unchecked"/--> </javac> </target> <!-- run unit tests --> <target name="test" description="test project"> <mkdir dir="${test.dir}"/> <antcall target="java-compile-tests"/> <mkdir dir="${test.result.dir}"/> <junitpdfreport todir="${test.result.dir}" styledir="src/resources/report/themes/default"> <fileset dir="${test.result.dir}"> <include name="TEST-*.xml"/> </fileset> </junitpdfreport> </target> <!-- checkstyle targets --> <!-- run checkstyle --> <target name="checkstyle" description="run checkstyle on the project"> <taskdef resource="checkstyletask.properties" classpath="${checkstyle.jar}"/> <mkdir dir="${checkstyle.result.dir}"/> <checkstyle config="${checkstyle.config}" failureProperty="checkstyle.failure" failOnViolation="false"> <formatter type="plain"/> <formatter type="xml" tofile="${checkstyle.result.dir}/checkstyle_report.xml"/> <fileset dir="${test.source.dir}" includes="**/*.java"/> </checkstyle> <style in="${checkstyle.result.dir}/checkstyle_report.xml" out="${checkstyle.result.dir}/checkstyle_report.html" style="${checkstyle.xsl}"/> </target> <!-- run pmd --> <target name="pmd"> <mkdir dir="${pmd.result.dir}"/> <path id="pmd.classpath"> <fileset dir="${pmd.lib}"> <include name="*.jar"/> </fileset> </path> <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/> <pmd rulesetfiles="unusedcode,basic,imports,design,controversial,strings" targetjdk="1.5"> <formatter type="net.sourceforge.pmd.renderers.HTMLRenderer" toFile="${pmd.result.dir}/standard-pmd.html"/> <formatter type="xml" toFile="${pmd.result.dir}/pmd.xml"/> <formatter type="text" toConsole="true"/> <fileset dir="${test.source.dir}"> <include name="**/*.java"/> </fileset> </pmd> <echo message="${basedir}"/> <replace file="${pmd.result.dir}/pmd.xml"> <replacefilter token="${basedir}/" value=""/> <replacefilter token="${basedir}\" value=""/> <replacefilter token="\" value="/"/> </replace> <xslt in="${pmd.result.dir}/pmd.xml" style="src/resources/etc/pmd-report.xslt" out="${pmd.result.dir}/pmd.html" /> </target> <target name="run" description="run project"> </target> <target name="audit" description="audit project" depends="checkstyle, pmd, test"> </target> <target name="debug" description="debug project"> <echo message="Welcome to Apps Unit Report."/> <echo message="Currently there's no (need for a) debug target."/> <echo message="Common targets:"/> <echo message=" - ant build: build the project."/> <echo message=" - ant run: execute examples."/> <echo message=" - ant test: test the project."/> <echo message=" - ant audit: audit the project."/> </target> <target name="all" description="run all targets"> <echo message="Welcome to Apps Report."/> <echo message="Common targets:"/> <echo message=" - ant build: build the project."/> <echo message=" - ant run: execute examples."/> <echo message=" - ant test: test the project."/> <echo message=" - ant audit: audit the project."/> </target> </project> \ No newline at end of file --- 1 ---- ! <?xml version="1.0"?> <!-- $Id$ $Revision$ $Date$ --> <project name="Apps Unit" basedir="." default="all"> <!-- Load local and user build preferences --> <property file="${user.home}/build.properties"/> <property file="build.properties"/> <!-- ========== Initialization Properties ================================= --> <property name="version" value="0_1_prerelease"/> <property name="build.dir" value="build"/> <!-- Should Java compilations set the debug compiler option? --> <property name="compile.debug" value="off" /> <!-- Should Java compilations set the deprecation compiler option? --> <property name="compile.deprecation" value="true" /> <!-- Should Java compilations set the optimize compiler option? --> <property name="compile.optimize" value="true" /> <!-- ========== Derived Properties ======================================== --> <property name="source.dir" value="./src"/> <!-- where the zipped distros are stored --> <property name="dist.dir" value="${build.dir}/dist"/> <!-- working directories where the distros are prepared --> <property name="dist.source.dir" value="${build.dir}/source_distribution"/> <property name="dist.bin.dir" value="${build.dir}/bin_distribution"/> <property name="dist.class.dir" value="${build.dir}/classes"/> <property name="checkstyle.result.dir" value="${build.dir}/checkstyle"/> <property name="pmd.result.dir" value="${build.dir}/pmd"/> <!-- compilation Classpath --> <path id="compile.classpath"> <pathelement location="${junit.jar}"/> <pathelement location="${commons-dbcp.jar}"/> <pathelement location="${commons-pool.jar}"/> </path> <!-- ========== Executable Targets ======================================== --> <target name="clean" description="clean build structure"> <delete dir="${build.dir}"/> </target> <target name="init" description="initialise build structure"> </target> <target name="build" description="build project" depends="init, init-build, build-bin, build-source"/> <target name="init-build"> <mkdir dir="${dist.dir}"/> </target> <target name="build-bin" depends="init-build"> <!-- create binary distribution --> <mkdir dir="${dist.bin.dir}"/> <copy todir="${dist.bin.dir}"> <fileset dir="${basedir}"> <include name="STATUS"/> <include name="README"/> <include name="cpl-v10.html"/> <include name="resources/**"/> </fileset> </copy> <!-- compile the java code --> <mkdir dir="${dist.class.dir}"/> <javac srcdir="${source.dir}" destdir="${dist.class.dir}" debug="${compile.debug}" optimize="${compile.optimize}" deprecation="${compile.deprecation}"> <exclude name="resources/**" /> <exclude name="**/package.html"/> <exclude name="**/overview.html"/> <classpath refid="compile.classpath"/> <!--compilerarg value="-Xlint:unchecked"/--> </javac> <jar basedir="${dist.class.dir}" destfile="${dist.bin.dir}/appsunit_${version}.jar"/> <zip basedir="${dist.bin.dir}" zipfile="${dist.dir}/appsunit_${version}.zip" compress="true"/> </target> <target name="build-source" depends="init-build"> <!-- create source distribution --> <mkdir dir="${dist.source.dir}"/> <copy todir="${dist.source.dir}"> <fileset dir="${basedir}"> <include name="STATUS"/> <include name="README"/> <include name="build.properties.sample"/> <include name="build.xml"/> <include name="cpl-v10.html"/> <include name="src/**"/> <include name="tst/**"/> <include name="resources/**"/> </fileset> </copy> <zip basedir="${dist.source.dir}" zipfile="${dist.dir}/appsunit_source_${version}.zip" compress="true"> </zip> </target> <target name="javadoc" description="generate javadocs"> </target> <!-- run unit tests --> <target name="test" description="test project"> </target> <!-- checkstyle targets --> <!-- run checkstyle --> <target name="checkstyle" description="run checkstyle on the project"> <taskdef resource="checkstyletask.properties" classpath="${checkstyle.jar}"/> <mkdir dir="${checkstyle.result.dir}"/> <checkstyle config="${checkstyle.config}" failureProperty="checkstyle.failure" failOnViolation="false"> <formatter type="plain"/> <formatter type="xml" tofile="${checkstyle.result.dir}/checkstyle_report.xml"/> <fileset dir="${source.dir}" includes="**/*.java"/> </checkstyle> <style in="${checkstyle.result.dir}/checkstyle_report.xml" out="${checkstyle.result.dir}/checkstyle_report.html" style="${checkstyle.xsl}"/> </target> <!-- run pmd --> <target name="pmd" description="run pmd on the project"> <mkdir dir="${pmd.result.dir}"/> <path id="pmd.classpath"> <fileset dir="${pmd.lib}"> <include name="*.jar"/> </fileset> </path> <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.classpath"/> <pmd rulesetfiles="unusedcode,basic,imports,design,controversial,strings" targetjdk="1.5"> <formatter type="net.sourceforge.pmd.renderers.HTMLRenderer" toFile="${pmd.result.dir}/standard-pmd.html"/> <formatter type="xml" toFile="${pmd.result.dir}/pmd.xml"/> <formatter type="text" toConsole="true"/> <fileset dir="${source.dir}"> <include name="**/*.java"/> </fileset> </pmd> <replace file="${pmd.result.dir}/pmd.xml"> <replacefilter token="${basedir}/" value=""/> <replacefilter token="${basedir}\" value=""/> <replacefilter token="\" value="/"/> </replace> <xslt in="${pmd.result.dir}/pmd.xml" style="${pmd.xsl}" out="${pmd.result.dir}/pmd.html" /> </target> <target name="run" description="run project"> </target> <target name="audit" description="audit project" depends="checkstyle, pmd, test"> </target> <target name="debug" description="debug project"> <echo message="Welcome to Apps Unit Report."/> <echo message="Currently there's no (need for a) debug target."/> <echo message="Common targets:"/> <echo message=" - ant build: build the project."/> <echo message=" - ant run: execute examples."/> <echo message=" - ant test: test the project."/> <echo message=" - ant audit: audit the project."/> </target> <target name="all" description="run all targets"> <echo message="Welcome to Apps Report."/> <echo message="Common targets:"/> <echo message=" - ant build: build the project."/> <echo message=" - ant run: execute examples."/> <echo message=" - ant test: test the project."/> <echo message=" - ant audit: audit the project."/> </target> </project> \ No newline at end of file |