Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add build rules for pdepend and phpmd.

  • Loading branch information...
commit dbf5b3c80ed05dfc1427bbb98578e2e3f38ed8a4 1 parent 4c30e6a
@realityking realityking authored
Showing with 49 additions and 1 deletion.
  1. +34 −1 build.xml
  2. +15 −0 build/phpmd.xml
View
35 build.xml
@@ -2,19 +2,32 @@
<project name="joomla" default="build" basedir=".">
<property name="source" value="." />
+ <property name="joomlasource" value="administrator,cli,components,includes,installation,libraries/cms,modules,plugins,templates" />
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/coverage" />
<delete dir="${basedir}/build/logs" />
+ <delete dir="${basedir}/build/jdepend" />
<mkdir dir="${basedir}/build/coverage" />
<mkdir dir="${basedir}/build/logs" />
+ <mkdir dir="${basedir}/build/jdepend" />
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="phpunit" />
</target>
+ <target name="parallelTasks" description="Run the pdepend, phpmd and phpcs tasks in parallel using a maximum of 2 threads.">
+ <parallel threadCount="2">
+ <sequential>
+ <antcall target="pdepend" />
+ <antcall target="phpmd" />
+ </sequential>
+ <antcall target="phpcs" />
+ </parallel>
+ </target>
+
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="phpcs">
<arg value="--report=checkstyle" />
@@ -25,5 +38,25 @@
</exec>
</target>
- <target name="build" depends="clean,phpunit,phpcs" />
+ <target name="pdepend" description="Generate jdepend.xml and software metrics charts 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 value="--ignore=build,tests" />
+ <arg path="${source}" />
+ </exec>
+ </target>
+
+ <target name="phpmd" description="Generate pmd.xml using PHPMD">
+ <exec executable="phpmd">
+ <arg path="${joomlasource}" />
+ <arg value="xml" />
+ <arg value="${basedir}/build/phpmd.xml" />
+ <arg value="--reportfile" />
+ <arg value="${basedir}/build/logs/pmd.xml" />
+ </exec>
+ </target>
+
+ <target name="build" depends="clean,phpunit,parallelTasks" />
</project>
View
15 build/phpmd.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<ruleset name="Custom rule set for the Joomla CMS."
+ 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>
+ Custom rule set for the Joomla CMS.
+ </description>
+
+ <!-- Import the entire unused code rule set -->
+ <rule ref="rulesets/unusedcode.xml" />
+</ruleset>
Please sign in to comment.
Something went wrong with that request. Please try again.