1 <?xml version="1.0" encoding="UTF-8"?>
3 <project name="phpMyAdmin" default="build" basedir=".">
4 <property name="source" value="."/>
5 <property name="source_comma_sep" value="."/>
7 <fileset dir="${source}" includes="js/*.js" id="jsfiles" />
8 <pathconvert pathsep=" " property="js-list" refid="jsfiles" />
10 <target name="clean" description="Clean up and create artifact directories">
11 <delete dir="${basedir}/build/api"/>
12 <delete dir="${basedir}/build/code-browser"/>
13 <delete dir="${basedir}/build/coverage"/>
14 <delete dir="${basedir}/build/logs"/>
15 <delete dir="${basedir}/build/pdepend"/>
17 <mkdir dir="${basedir}/build/api"/>
18 <mkdir dir="${basedir}/build/code-browser"/>
19 <mkdir dir="${basedir}/build/coverage"/>
20 <mkdir dir="${basedir}/build/logs"/>
21 <mkdir dir="${basedir}/build/pdepend"/>
24 <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
25 <exec executable="phpunit">
26 <arg line="--configuration phpunit.xml.dist"/>
30 <target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
31 <exec executable="phpunit">
32 <arg line="--configuration phpunit.xml.nocoverage"/>
36 <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
37 <exec executable="pdepend">
38 <arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
39 '--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
40 '--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
41 ${source_comma_sep}" />
45 <target name="phpmd" description="Generate pmd.xml using PHPMD">
46 <exec executable="phpmd">
47 <arg line="${source_comma_sep}
49 codesize,design,naming,unusedcode
50 --exclude test,build,tcpdf,php-gettext,bfShapeFiles,PMAStandard,phpseclib
51 --reportfile '${basedir}/build/logs/pmd.xml'" />
55 <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
56 <exec executable="phpcpd">
57 <arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
61 --exclude libraries/tcpdf
62 --exclude libraries/php-gettext
63 --exclude libraries/bfShapeFiles
64 --exclude libraries/phpseclib
69 <target name="phploc" description="Generate phploc.csv">
70 <exec executable="phploc">
71 <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
75 --exclude libraries/tcpdf
76 --exclude libraries/php-gettext
77 --exclude libraries/bfShapeFiles
78 --exclude libraries/phpseclib
83 <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, tcpdf directories">
84 <exec executable="phpcs">
86 --ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*
88 --report-file='${basedir}/build/logs/checkstyle.xml'
89 --standard=PMAStandard
94 <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
95 <exec executable="phpdoc">
96 <arg line="-d ${source} -t '${basedir}/build/api'" />
100 <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
101 <exec executable="phpcb">
102 <arg line="--log '${basedir}/build/logs'
104 --output '${basedir}/build/code-browser'" />
108 <target name="jshint" description="Javascript checks">
109 <exec executable="jshint" output="${basedir}/build/logs/jslint.xml">
110 <arg line="--jslint-reporter ${js-list}" />
114 <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb"/>