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="."/>
6 <property environment="env"/>
7 <property name="env.PHPUNIT_XML" value="phpunit.xml.dist"/>
9 <target name="clean" description="Clean up and create artifact directories">
10 <delete dir="${basedir}/build/api"/>
11 <delete dir="${basedir}/build/code-browser"/>
12 <delete dir="${basedir}/build/coverage"/>
13 <delete dir="${basedir}/build/logs"/>
14 <delete dir="${basedir}/build/pdepend"/>
16 <mkdir dir="${basedir}/build/api"/>
17 <mkdir dir="${basedir}/build/code-browser"/>
18 <mkdir dir="${basedir}/build/coverage"/>
19 <mkdir dir="${basedir}/build/logs"/>
20 <mkdir dir="${basedir}/build/pdepend"/>
23 <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
24 <exec executable="phpunit" failonerror="true">
25 <arg line="--configuration ${env.PHPUNIT_XML}"/>
29 <target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
30 <exec executable="phpunit" failonerror="true">
31 <arg line="--configuration phpunit.xml.nocoverage"/>
35 <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
36 <exec executable="pdepend">
37 <arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
38 '--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
39 '--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
40 ${source_comma_sep}" />
44 <target name="phpmd" description="Generate pmd.xml using PHPMD">
45 <exec executable="phpmd">
46 <arg line="${source_comma_sep}
48 codesize,design,naming,unusedcode
49 --exclude test,build,tcpdf,php-gettext,bfShapeFiles,PMAStandard,phpseclib,recaptchalib.php,swekey.php
50 --reportfile '${basedir}/build/logs/pmd.xml'" />
54 <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
55 <exec executable="phpcpd">
56 <arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
60 --exclude libraries/tcpdf
61 --exclude libraries/php-gettext
62 --exclude libraries/bfShapeFiles
63 --exclude libraries/phpseclib
64 --exclude libraries/plugins/auth/recaptchalib.php
65 --exclude libraries/plugins/auth/swekey/swekey.php
70 <target name="phploc" description="Generate phploc.csv">
71 <exec executable="phploc">
72 <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
76 --exclude libraries/tcpdf
77 --exclude libraries/php-gettext
78 --exclude libraries/bfShapeFiles
79 --exclude libraries/phpseclib
80 --exclude libraries/plugins/auth/recaptchalib.php
81 --exclude libraries/plugins/auth/swekey/swekey.php
86 <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, tcpdf directories">
87 <exec executable="phpcs">
89 --ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*,*/recaptchalib.php,*/swekey.php
92 --report-file='${basedir}/build/logs/checkstyle.xml'
93 --standard=PMAStandard
98 <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
99 <exec executable="phpdoc">
100 <arg line="-d ${source} -t '${basedir}/build/api'" />
104 <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
105 <exec executable="phpcb">
106 <arg line="--log '${basedir}/build/logs'
108 --output '${basedir}/build/code-browser'" />
112 <target name="jshint" description="Javascript checks">
113 <apply executable="jshint" output="${basedir}/build/logs/jslint.xml" parallel="true">
114 <arg line="--config ./.jshintrc --jslint-reporter" />
115 <fileset dir="${basedir}">
116 <include name="js/pmd/*.js" />
117 <include name="js/*.js" />
118 <include name="setup/*.js" />
123 <target name="lint" description="Perform syntax check of sourcecode files">
124 <apply executable="php" failonerror="true">
127 <fileset dir="${basedir}">
128 <include name="libraries/**/*.php" />
129 <include name="setup/**/*.php" />
130 <include name="test/**/*.php" />
131 <include name="*.php" />
137 <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint"/>