Refactored ConfigFile class so that it is no longer a singleton
[phpmyadmin.git] / build.xml
blobe4427da96d4800694fb372712bb62eb730aa1a9c
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"/>
21  </target>
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}"/>
26   </exec>
27  </target>
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"/>
32   </exec>
33  </target>
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}" />
41   </exec>
42  </target>
44  <target name="phpmd" description="Generate pmd.xml using PHPMD">
45   <exec executable="phpmd">
46    <arg line="${source_comma_sep}
47               xml
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'" />
51   </exec>
52  </target>
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'
57               --exclude test
58               --exclude PMAStandard
59               --exclude build
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
66               ${source}" />
67   </exec>
68  </target>
70  <target name="phploc" description="Generate phploc.csv">
71   <exec executable="phploc">
72    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
73               --exclude test
74               --exclude PMAStandard
75               --exclude build
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
82               ${source}" />
83   </exec>
84  </target>
86  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, tcpdf directories">
87   <exec executable="phpcs">
88    <arg line="
89               --ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*,*/recaptchalib.php,*/swekey.php
90               --report=checkstyle
91               --extensions=php
92               --report-file='${basedir}/build/logs/checkstyle.xml'
93               --standard=PMAStandard
94               ${source}" />
95   </exec>
96  </target>
98  <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
99   <exec executable="phpdoc">
100    <arg line="-d ${source} -t '${basedir}/build/api'" />
101   </exec>
102  </target>
104  <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
105   <exec executable="phpcb">
106    <arg line="--log    '${basedir}/build/logs'
107               --source '${source}'
108               --output '${basedir}/build/code-browser'" />
109   </exec>
110  </target>
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" />
119    </fileset>
120   </apply>
121  </target>
123  <target name="lint" description="Perform syntax check of sourcecode files">
124   <apply executable="php" failonerror="true">
125    <arg value="-l" />
127    <fileset dir="${basedir}">
128     <include name="libraries/**/*.php" />
129     <include name="setup/**/*.php" />
130     <include name="test/**/*.php" />
131     <include name="*.php" />
132     <modified />
133    </fileset>
134   </apply>
135  </target>
137  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint"/>
138 </project>