Merge remote-tracking branch 'origin/QA_4_0' into QA_4_0
[phpmyadmin.git] / build.xml
blobcc419ed6b56a1e88481a0900b42e6884da08141d
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"/>
22  </target>
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"/>
27   </exec>
28  </target>
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"/>
33   </exec>
34  </target>
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}" />
42   </exec>
43  </target>
45  <target name="phpmd" description="Generate pmd.xml using PHPMD">
46   <exec executable="phpmd">
47    <arg line="${source_comma_sep}
48               xml
49               codesize,design,naming,unusedcode
50               --exclude test,build,tcpdf,php-gettext,bfShapeFiles,PMAStandard,phpseclib
51               --reportfile '${basedir}/build/logs/pmd.xml'" />
52   </exec>
53  </target>
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'
58               --exclude test
59               --exclude PMAStandard
60               --exclude build
61               --exclude libraries/tcpdf
62               --exclude libraries/php-gettext
63               --exclude libraries/bfShapeFiles
64               --exclude libraries/phpseclib
65               ${source}" />
66   </exec>
67  </target>
69  <target name="phploc" description="Generate phploc.csv">
70   <exec executable="phploc">
71    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
72               --exclude test
73               --exclude PMAStandard
74               --exclude build
75               --exclude libraries/tcpdf
76               --exclude libraries/php-gettext
77               --exclude libraries/bfShapeFiles
78               --exclude libraries/phpseclib
79               ${source}" />
80   </exec>
81  </target>
83  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, tcpdf directories">
84   <exec executable="phpcs">
85    <arg line="
86               --ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*
87               --report=checkstyle
88               --report-file='${basedir}/build/logs/checkstyle.xml'
89               --standard=PMAStandard
90               ${source}" />
91   </exec>
92  </target>
94  <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
95   <exec executable="phpdoc">
96    <arg line="-d ${source} -t '${basedir}/build/api'" />
97   </exec>
98  </target>
100  <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
101   <exec executable="phpcb">
102    <arg line="--log    '${basedir}/build/logs'
103               --source '${source}'
104               --output '${basedir}/build/code-browser'" />
105   </exec>
106  </target>
108  <target name="jshint" description="Javascript checks">
109   <exec executable="jshint" output="${basedir}/build/logs/jslint.xml">
110    <arg line="--jslint-reporter ${js-list}" />
111   </exec>
112  </target>
114  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb"/>
115 </project>