@ -1,32 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project name= "islandora" default= "build" >
<project name= "islandora" default= "build" >
<target name= "build"
<target name= "build" depends= "clean,prepare,lint,phploc,code_sniff,phpcpd,pdepend,doxygen,phpcb,test" />
depends="prepare,lint,doxygen,phploc,pdepend,phpcs-ci,phpcpd,phpcb"/>
<target name= "clean" description= "Cleanup build artifacts" >
<target name= "clean" description= "Cleanup build artifacts" >
<delete dir= "${basedir}/build/api" />
<delete dir= "${basedir}/build/test" />
<delete dir= "${basedir}/build/code-browser" />
<delete dir= "${basedir}/build/logs" />
<delete dir= "${basedir}/build/coverage" />
<delete dir= "${basedir}/build/pdepend" />
<delete dir= "${basedir}/build/logs" />
<delete dir= "${basedir}/build/api" />
<delete dir= "${basedir}/build/pdepend" />
<delete dir= "${basedir}/build/code-browser" />
</target>
</target>
<target name= "prepare" depends= "clean"
<target name= "prepare" description= "Prepares workspace for artifacts" >
description="Prepare for build">
<mkdir dir= "${basedir}/build/test" />
<mkdir dir= "${basedir}/build/api" />
<mkdir dir= "${basedir}/build/logs" />
<mkdir dir= "${basedir}/build/code-browser" />
<mkdir dir= "${basedir}/build/pdepend" />
<mkdir dir= "${basedir}/build/coverage" />
<mkdir dir= "${basedir}/build/api" />
<mkdir dir= "${basedir}/build/logs" />
<mkdir dir= "${basedir}/build/code-browser" />
<mkdir dir= "${basedir}/build/pdepend" />
</target>
</target>
<target name= "lint" >
<target name= "lint" description= "Perform syntax check of sourcecode files " >
<apply executable= "php" failonerror= "true" >
<apply executable= "php" failonerror= "true" >
<arg value= "-l" />
<arg value= "-l" />
<fileset dir= "${basedir}" >
<fileset dir= "${basedir}" >
<include name= "**/*.php" />
<include name= "**/*.php" />
<include name= "**/*.inc" />
<include name= "**/*.module" />
<include name= "**/*.install" />
<include name= "**/*.test" />
<modified />
<modified />
</fileset>
</fileset>
</apply>
</apply>
@ -34,77 +36,49 @@
<target name= "phploc" description= "Measure project size using PHPLOC" >
<target name= "phploc" description= "Measure project size using PHPLOC" >
<exec executable= "phploc" >
<exec executable= "phploc" >
<arg value= "--log-csv" />
<arg line= "--log-csv ${basedir}/build/logs/phploc.csv --exclude build --exclude css --exclude images --exclude xml --names *.php,*.module,*.inc,*.test,*.install ${basedir}" />
<arg value= "${basedir}/build/logs/phploc.csv" />
<arg path= "${basedir}" />
</exec>
</exec>
</target>
</target>
<target name= "pdepend"
<target name= "code_sniff" description= "Checks the code for Drupal coding standard violations" >
description="Calculate software metrics using PHP_Depend">
<exec executable= "pdepend" >
<arg value= "--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value= "--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value= "--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path= "${basedir}" />
</exec>
</target>
<target name= "phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable= "phpcs" >
<exec executable= "phpcs" >
<arg value= "--standard=Drupal" />
<arg line= "--standard=Drupal --report=checkstyle --report-file=${basedir}/build/logs/checkstyle.xml --extensions=php,inc,test,module,install --ignore=build/,xml/,images/,css/ ${basedir}" />
<arg value= "--extensions=php" />
<arg value= "--ignore=build/" />
<arg path= "${basedir}" />
</exec>
</exec>
</target>
</target>
<target name= "phpcs-ci"
<target name= "phpcpd" description= "Copy/Paste code detection" >
description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable= "phpcpd" >
<exec executable= "phpcs" output= "/dev/null" >
<arg line= "--log-pmd ${basedir}/build/logs/pmd-cpd.xml --exclude build --exclude css --exclude images --exclude xml --names *.php,*.module,*.inc,*.test,*.install ${basedir}" />
<arg value= "--report=checkstyle" />
<arg value= "--extensions=php" />
<arg value= "--ignore=build/" />
<arg value= "--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value= "--standard=Drupal" />
<arg path= "${basedir}" />
</exec>
</exec>
</target>
</target>
<target name= "phpcpd" description= "Find duplicate code using PHPCPD" >
<target name= "pdepend" description= "Calculate software metrics using PHP_Depend" >
<exec executable= "phpcpd" >
<exec executable= "pdepend" >
<arg value= "--log-pmd" />
<arg line= "--jdepend-xml=${basedir}/build/logs/jdepend.xml --jdepend-chart=${basedir}/build/pdepend/dependencies.svg --overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg ${basedir}" />
<arg value= "${basedir}/build/logs/pmd-cpd.xml" />
<arg path= "${basedir}" />
</exec>
</exec>
</target>
</target>
<target name= "doxygen" description= "Generate API documentation with doxygen" depends= "prepare" >
<target name= "doxygen" description= "Generate API documentation with doxygen" depends= "prepare" >
<echo file= "${basedir}/build/Doxyfile" append= "true" message= "PROJECT_NUMBER = " />
<exec executable= "bash" >
<exec executable= "git" output= "${basedir}/build/Doxyfile" append= "true" >
<arg line= '-c "sed -i s/PROJECT_NUMBER\ \ \ \ \ \ \ \ \ =/PROJECT_NUMBER\ \ \ \ \ \ \ \ \ =\ `git log -1 --pretty=format:%h`/ build/Doxyfile"' />
<arg value= "log" />
<arg value= "-1" />
<arg value= "--pretty=format:%h" />
</exec>
</exec>
<exec executable= "doxygen" >
<exec executable= "doxygen" >
<arg path ="${basedir}/build/Doxyfile" />
<arg line= "${basedir}/build/Doxyfile" />
</exec>
</exec>
<exec executable= "git" >
<exec executable= "git" >
<arg value= "checkout" />
<arg line= "checkout ${basedir}/build/Doxyfile" />
<arg path= "${basedir}/build/Doxyfile" />
</exec>
</exec>
</target>
</target>
<target name= "phpcb"
<target name= "phpcb" description= "Aggregate tool output with PHP_CodeBrowser" >
description="Aggregate tool output with PHP_CodeBrowser">
<exec executable= "phpcb" >
<exec executable= "phpcb" >
<arg value= "--log" />
<arg line= "--log ${basedir}/build/logs --source ${basedir} --output ${basedir}/build/code-browser" />
<arg path= "${basedir}/build/logs" />
</exec>
<arg value= "--source" />
</target>
<arg path= "${basedir}" />
<arg value= "--output" />
<target name= "test" >
<arg path= "${basedir}/build/code-browser" />
<exec executable= "bash" >
<arg line= '-c "php ../../../../scripts/run-tests.sh --xml ${basedir}/build/test Islandora"' />
</exec>
</exec>
</target>
</target>
</project>
</project>