Permalink
Browse files

Added some targets to the build script. docblox is now used for API docs

  • Loading branch information...
1 parent e036513 commit c2bef99f2b3ecbb2a948f1374b21849fec319f53 @christeredvartsen committed Dec 15, 2011
Showing with 95 additions and 33 deletions.
  1. +3 −0 .gitignore
  2. +61 −33 build.xml.dist
  3. +15 −0 docblox.xml.dist
  4. +16 −0 phpmd.xml.dist
View
@@ -1,4 +1,7 @@
build
phpunit.xml
build.xml
+docblox.xml
+phpmd.xml
+cache.properties
.idea
View
@@ -1,42 +1,70 @@
-<project name="phpbt" default="build" basedir=".">
- <target name="clean">
- <delete dir="${basedir}/build"/>
- <mkdir dir="${basedir}/build/coverage" />
- <mkdir dir="${basedir}/build/logs" />
- <mkdir dir="${basedir}/build/docs" />
- <mkdir dir="${basedir}/build/code-browser" />
- </target>
-
- <target name="phpunit">
- <exec executable="phpunit" failonerror="true">
- <arg line="-c ${basedir}/phpunit.xml tests" />
- </exec>
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="PHP BitTorrent" default="build" basedir=".">
+ <property name="source" value="${basedir}/PHP" />
+ <property name="build" value="${basedir}/build" />
+
+ <target name="clean" description="Clean up and create artifact directories">
+ <delete dir="${build}"/>
+ <mkdir dir="${build}/coverage" />
+ <mkdir dir="${build}/logs" />
+ <mkdir dir="${build}/docs" />
+ <mkdir dir="${build}/code-browser" />
+ <mkdir dir="${build}/pdepend" />
</target>
-
- <target name="phpdoc">
- <exec executable="phpdoc">
- <arg line="-d ${basedir}/PHP/BitTorrent
- -t ${basedir}/build/docs
- -ti 'API docs for PHP_BitTorrent'
- -ct codeCoverageIgnore" />
- </exec>
+
+ <target name="lint">
+ <apply executable="php" failonerror="true">
+ <arg value="-l" />
+
+ <fileset dir="${source}">
+ <include name="**/*.php" />
+ <modified />
+ </fileset>
+
+ <fileset dir="${basedir}/tests">
+ <include name="**/*.php" />
+ <modified />
+ </fileset>
+ </apply>
</target>
-
- <target name="phploc">
+
+ <target name="phpunit" description="Run unit tests using PHPUnit and generate junit.xml and clover.xml (config in phpunit.xml)">
+ <exec executable="phpunit" failonerror="true"/>
+ </target>
+
+ <target name="docblox" description="Generate API documentation using DocBlox (config in docblox.xml)">
+ <exec executable="docblox"/>
+ </target>
+
+ <target name="phploc" description="Generate phploc data">
<exec executable="phploc">
- <arg line="--log-csv ${basedir}/build/logs/phploc.csv
- --log-xml ${basedir}/build/logs/phploc.xml
- ${basedir}/PHP/BitTorrent" />
+ <arg line="--log-csv ${build}/logs/phploc.csv --log-xml ${build}/logs/phploc.xml ${source}"/>
</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}/PHP/BitTorrent
- --output ${basedir}/build/code-browser" />
+ <arg line="--log ${build}/logs --source ${source} --output ${build}/code-browser"/>
+ </exec>
+ </target>
+
+ <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
+ <exec executable="phpcpd">
+ <arg line="--log-pmd ${build}/logs/pmd-cpd.xml ${source}"/>
</exec>
</target>
-
- <target name="build" depends="clean,phpunit,phpdoc,phploc,phpcb" />
+
+ <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
+ <exec executable="pdepend">
+ <arg line="--jdepend-xml=${build}/logs/jdepend.xml --jdepend-chart=${build}/pdepend/dependencies.svg --overview-pyramid=${build}/pdepend/overview-pyramid.svg ${source}"/>
+ </exec>
+ </target>
+
+ <target name="phpmd" description="Generate pmd.xml using PHPMD (configuration in phpmd.xml)">
+ <exec executable="phpmd">
+ <arg line="${source} html ${basedir}/phpmd.xml --reportfile ${build}/logs/pmd.html"/>
+ </exec>
+ </target>
+
+ <target name="build" depends="clean,lint,phpunit,docblox,phploc,phpcb,phpcpd,pdepend,phpmd"/>
</project>
View
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<docblox>
+ <parser>
+ <target>build/docs</target>
+ </parser>
+ <transformer>
+ <target>build/docs</target>
+ </transformer>
+ <transformations>
+ <template name="default" />
+ </transformations>
+ <files>
+ <directory>PHP</directory>
+ </files>
+</docblox>
View
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<ruleset name="PHP BitTorrent rule set"
+ xmlns="http://pmd.sf.net/ruleset/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
+ xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
+ <description>Ruleset for PHP BitTorrent</description>
+ <rule ref="rulesets/codesize.xml" />
+ <rule ref="rulesets/design.xml" />
+ <rule ref="rulesets/naming.xml">
+ <exclude name="ShortVariable" />
+ </rule>
+ <rule ref="rulesets/unusedcode.xml">
+ <exclude name="UnusedFormalParameter" />
+ </rule>
+</ruleset>

0 comments on commit c2bef99

Please sign in to comment.