Permalink
Browse files

Adding files for continuous integration

  • Loading branch information...
1 parent 4548c9a commit 9ebf8b856bc28043a1a487068c7d95d62f039680 @ianmacl ianmacl committed Jun 20, 2011
Showing with 185 additions and 7 deletions.
  1. +116 −0 build.xml
  2. +38 −0 build/phpcs.xml
  3. +12 −0 build/phpmd.xml
  4. +19 −0 phpunit.xml.dist
  5. +0 −7 tests/phpunit.xml.dist
View
116 build.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project name="joomla-platform" default="build" basedir=".">
+ <property name="source" value="libraries"/>
+
+ <target name="clean"
+ description="Clean up and create artifact directories">
+ <delete dir="${basedir}/build/api"/>
+ <delete dir="${basedir}/build/code-browser"/>
+ <delete dir="${basedir}/build/coverage"/>
+ <delete dir="${basedir}/build/logs"/>
+ <delete dir="${basedir}/build/pdepend"/>
+
+ <mkdir dir="${basedir}/build/api"/>
+ <mkdir dir="${basedir}/build/code-browser"/>
+ <mkdir dir="${basedir}/build/coverage"/>
+ <mkdir dir="${basedir}/build/logs"/>
+ <mkdir dir="${basedir}/build/pdepend"/>
+ </target>
+
+ <target name="phpunit"
+ description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
+ <exec executable="phpunit" failonerror="true"/>
+ </target>
+
+ <target name="parallelTasks"
+ description="Run the pdepend, phpmd, phpcpd, phpcs, phpdoc 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="phploc"/>
+ </parallel>
+ </target>
+
+ <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 path="${source}" />
+ </exec>
+ </target>
+
+ <target name="phpmd"
+ description="Generate pmd.xml using PHPMD">
+ <exec executable="phpmd">
+ <arg path="${source}" />
+ <arg value="xml" />
+ <arg value="${basedir}/build/phpmd.xml" />
+ <arg value="--reportfile" />
+ <arg value="${basedir}/build/logs/pmd.xml" />
+ </exec>
+ </target>
+
+ <target name="phpcpd"
+ description="Generate pmd-cpd.xml using PHPCPD">
+ <exec executable="phpcpd">
+ <arg value="--log-pmd" />
+ <arg value="${basedir}/build/logs/pmd-cpd.xml" />
+ <arg path="${source}" />
+ </exec>
+ </target>
+
+ <target name="phploc"
+ description="Generate phploc.csv">
+ <exec executable="phploc">
+ <arg value="--log-csv" />
+ <arg value="${basedir}/build/logs/phploc.csv" />
+ <arg path="${source}" />
+ </exec>
+ </target>
+
+ <target name="phpcs"
+ description="Generate checkstyle.xml using PHP_CodeSniffer">
+ <exec executable="phpcs" output="/dev/null">
+ <arg value="--report=checkstyle" />
+ <arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
+ <arg value="--standard=${basedir}/build/phpcs.xml" />
+ <arg path="${source}" />
+ </exec>
+ </target>
+
+ <target name="phpdoc"
+ description="Generate API documentation using PHPDocumentor">
+ <exec executable="phpdox">
+ <arg value="-c" />
+ <arg path="${source}" />
+ <arg value="-d" />
+ <arg path="${basedir}/build/api" />
+ <arg value="-x" />
+ <arg path="${basedir}/build/logs" />
+ <arg value="-g" />
+ <arg value="html" />
+ </exec>
+ </target>
+
+ <target name="phpcb"
+ description="Aggregate tool output with PHP_CodeBrowser">
+ <exec executable="phpcb">
+ <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,parallelTasks,phpunit,phpcb"/>
+</project>
View
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<ruleset name="PEAR">
+ <description>The PEAR coding standard.</description>
+
+ <!-- Include some additional sniffs from the Generic standard -->
+ <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
+ <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
+ <rule ref="Generic.PHP.DisallowShortOpenTag"/>
+ <!--<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>-->
+
+ <!-- Lines can be 85 chars long, but never show errors -->
+ <rule ref="Generic.Files.LineLength">
+ <properties>
+ <property name="lineLimit" value="130"/>
+ <property name="absoluteLineLimit" value="0"/>
+ </properties>
+ </rule>
+
+ <!-- Use Unix newlines -->
+ <rule ref="Generic.Files.LineEndings">
+ <properties>
+ <property name="eolChar" value="\n"/>
+ </properties>
+ </rule>
+
+ <!-- This messgae is not required as spaces are allowed for alignment -->
+ <rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
+ <severity>0</severity>
+ </rule>
+
+ <!-- Use warnings for inline control structures -->
+ <rule ref="Generic.ControlStructures.InlineControlStructure">
+ <properties>
+ <property name="error" value="false"/>
+ </properties>
+ </rule>
+
+</ruleset>
View
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<ruleset name="My first PHPMD 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>
+ My custom rule set that checks my code...
+ </description>
+</ruleset>
View
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit
+ bootstrap="tests/bootstrap.php"
+ colors="true">
+
+ <testsuite name="AllTests">
+ <directory>tests/suite</directory>
+ </testsuite>
+
+ <logging>
+ <log type="coverage-html" target="build/coverage" title="Joomla-Platform"
+ charset="UTF-8" yui="true" highlight="true"
+ lowUpperBound="35" highLowerBound="70"/>
+ <log type="coverage-clover" target="build/logs/clover.xml"/>
+ <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
+ </logging>
+
+</phpunit>
View
@@ -1,7 +0,0 @@
-<phpunit
- bootstrap="bootstrap.php"
- colors="true">
- <testsuite name="AllTests">
- <directory>suite</directory>
- </testsuite>
-</phpunit>

0 comments on commit 9ebf8b8

Please sign in to comment.