dolibarr/build.xml
2011-09-17 15:18:44 +00:00

89 lines
2.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="dolibarr" default="hudson" basedir=".">
<!-- Exclude/ignore paths -->
<property name="ignorepaths" value="htdocs/includes/adodbtime,htdocs/includes/artichow,htdocs/includes/barcode/php-barcode,htdocs/includes/ckeditor,htdocs/includes/fpdf,htdocs/includes/fpdfi,htdocs/includes/geoip,htdocs/includes/iwebkit,htdocs/includes/jquery,htdocs/includes/jsgantt,htdocs/includes/nusoap,htdocs/includes/odtphp,htdocs/includes/phpexcel,htdocs/includes/tcpdf" />
<target name="clean">
<!-- Clean up -->
<delete dir="${basedir}/hudson"/>
<delete dir="${basedir}/generatedJUnitFiles"/>
<!-- Create build directories -->
<mkdir dir="${basedir}/hudson/doxygen"/>
<mkdir dir="${basedir}/hudson/logs"/>
<mkdir dir="${basedir}/hudson/coverage"/>
</target>
<!-- Run phpmd, phpcpd, phpcs, doxygen and phploc in parallel -->
<target name="parallelTasks">
<parallel>
<antcall target="phpmd"/>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="doxygen"/>
<antcall target="phploc"/>
</parallel>
</target>
<!-- Generate pmd.xml -->
<target name="phpmd">
<exec executable="phpmd">
<arg line="htdocs xml codesize,unusedcode
--reportfile '${basedir}/hudson/logs/pmd.xml'
--exclude '${ignorepaths}'
" />
</exec>
</target>
<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<exec executable="phpcpd">
<arg line="--log-pmd '${basedir}/hudson/logs/pmd-cpd.xml'
--exclude '${ignorepaths}'
htdocs
" />
</exec>
</target>
<!-- Generate phploc.csv -->
<target name="phploc">
<exec executable="phploc">
<arg line="--log-csv '${basedir}/hudson/logs/phploc.csv'
--exclude '${ignorepaths}'
htdocs
" />
</exec>
</target>
<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs" dir="${basedir}" output="${basedir}/hudson/logs/checkstyle.xml">
<arg line=" --standard=${basedir}/dev/codesniffer/ruleset.xml
--report=checkstyle
--ignore=${ignorepaths}
htdocs
"/>
</exec>
</target>
<!-- Generate Doxygen documentation -->
<target name="doxygen" description="Dolibarr documentation" >
<exec executable="doxygen" dir="${basedir}" failonerror="false">
<arg value="${basedir}/build/doxygen/hudson-doxygen.doxyfile"/>
</exec>
</target>
<!-- Run unit tests and generate junit.xml and clover.xml -->
<target name="phpunit">
<exec executable="phpunit" dir="${basedir}" failonerror="true">
<arg line=" --log-junit ${basedir}/hudson/logs/junit.xml
--coverage-clover ${basedir}/hudson/coverage/clover.xml
--coverage-html ${basedir}/hudson/coverage/
test/phpunit/AllTests.php
"/>
</exec>
</target>
<target name="hudson" depends="clean,parallelTasks,phpunit"/>
</project>