Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Commit

Permalink
quick docs for installing various php tools and a number if tweaks to
Browse files Browse the repository at this point in the history
the build.xml script
  • Loading branch information
michaelalber committed Sep 9, 2011
1 parent e04e581 commit e71bdb7
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 42 deletions.
36 changes: 36 additions & 0 deletions docs/phptools.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
The build / test process requires a number of PHP tools.
This is a list of the tools and some quick instructions on how to install them.

* PHPUnit - http://goo.gl/e0ZAD
* phpLOC - http://goo.gl/6Evom
* PhpCodeSniffer - http://goo.gl/UyS04
* PHP_CodeSniffer: phpcs-sebastian - http://goo.gl/nDqrU
* phpMD - http://goo.gl/L8PLx
* phpCPD - http://goo.gl/8SAeF
* PHPDepend - http://goo.gl/GT6YF

* Install phpXXX Tools
$ yum install ImageMagick ImageMagick-devel

pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear channel-discover components.ez.no
pear channel-discover pear.phpmd.org
pear channel-discover pear.pdepend.org
pear install --alldeps phpunit/PHPUnit
pear install phpunit/PHP_CodeBrowser
pear install phpunit/phpdcd-beta
pear install --alldeps phpunit/phploc
pear install PHP_Codesniffer
pear install --alldeps phpmd/PHP_PMD
pear install phpunit/phpcpd

* phpDocumentor - http://goo.gl/ss455
pear install PhpDocumentor

* DocBlox - http://goo.gl/m81SR and http://goo.gl/rFIwh
$ yum install graphviz

pear channel-discover pear.michelf.com
pear channel-discover pear.docblox-project.org
pear install --alldeps docblox/DocBlox-beta
118 changes: 76 additions & 42 deletions tests/build.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
<project name="Zend Framework Best Practice" default="build">
<target name="clean">
<project name="Zend Framework Best Practice" default="build" basedir=".">
<property name="source" value="${basedir}/../application"/>

<target name="clean"
description="Clean up artifact directories">
<delete dir="${basedir}/build"/>
</target>

<target name="prepare">
<target name="prepare"
description="Create artifact directories">
<mkdir dir="${basedir}/build"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/docs"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>

<target name="phpunit"
description="Run unit tests using PHPUnit and generates reports">
<exec dir="${basedir}" executable="phpunit" failonerror="false"/>
<exec dir="${basedir}" executable="phpunit" failonerror="false" />
</target>

<!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
<target name="parallelTasks">
<parallel>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<!--<antcall target="phpdoc"/>-->
<target name="parallelTasks"
description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc / docblox and phploc tasks in parallel using a maximum of 2 threads.">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc"/>
<!-- <antcall target="docblox"/> -->
<antcall target="phploc"/>
</parallel>
</target>

<!-- Generate jdepend.xml and software metrics charts -->
<target name="pdepend">
<target name="pdepend"
description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="--jdepend-xml=${basedir}/build/logs/jdepend.xml
--jdepend-chart=${basedir}/build/pdepend/dependencies.svg
Expand All @@ -39,54 +47,80 @@
</exec>
</target>

<!-- Generate pmd.xml -->
<target name="phpmd">
<target name="phpmd"
description="Generate pmd.xml using PHPMD">
<exec executable="phpmd">
<arg line="${basedir} xml codesize,unusedcode
--reportfile ${basedir}/build/logs/pmd.xml" />
<arg path="${source}" />
<arg value="xml codesize,unusedcode" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>

<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<target name="phpcpd"
description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml ${basedir}/../application" />
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${source}" />
</exec>
</target>

<target name="phploc">
<target name="phploc"
description="Generate phploc.xml">
<exec dir="${basedir}" executable="phploc" failonerror="false">
<arg line="--log-xml ${basedir}/build/logs/phploc.xml
${basedir}/../application" />
<arg value="--log-xml" />
<arg value="${basedir}/build/logs/phploc.xml" />
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${source}" />
</exec>
</target>

<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs" output="/dev/null">
<arg line="--report=checkstyle
--report-file=${basedir}/build/logs/checkstyle.xml
--standard=Sebastian
${basedir}/../application" />
<target name="phpcs"
description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="phpcs" output="/dev/null" dir="${source}/">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=Sebastian" />
<arg path="${source}" />
</exec>
</target>

<!-- Generate API documentation -->
<target name="phpdoc">
<exec dir="${basedir}/../library/phpDocumentor" executable="./phpdoc" failonerror="false">
<arg line="--directory ${basedir}/../application
--target ${basedir}/build/api"/>
<target name="phpdoc"
description="Generate API documentation using phpDocumentor">
<exec executable="phpdoc" failonerror="false">
<arg value="--directory" />
<arg path="${source}" />
<arg value="--target" />
<arg path="${basedir}/build/api" />
</exec>
</target>

<target name="docblox"
description="Generate API documentation using DocBlox">
<exec executable="docblox" failonerror="false">
<arg value="-d" />
<arg path="${source}" />
<arg value="-t" />
<arg path="${basedir}/build/api" />
<arg line="--title '${ant.project.name}'" />
</exec>
</target>

<target name="phpcb">
<target name="phpcb"
description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg line="--log ${basedir}/build/logs
--source ${basedir}/../application
--output ${basedir}/build/code-browser" />
<arg value="--log" />
<arg path="${basedir}/build/logs" />
<arg value="--source" />
<arg path="${source}" />
<arg value="--output" />
<arg path="${basedir}/build/code-browser" />
</exec>
</target>

<target name="build" depends="clean,prepare,phpunit,phpcpd,phploc,parallelTasks,phpcb"/>
<target name="build" depends="clean,prepare,parallelTasks,phpunit,phpcb"/>

</project>

0 comments on commit e71bdb7

Please sign in to comment.