Merge pull request #431 from xmujay/0609_monitor
[phpmyadmin/aamir.git] / build.xml
blob1d84087bfd0b23269b01fd59bf7ee8ff30d14c0e
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  <target name="clean" description="Clean up and create artifact directories">
8   <delete dir="${basedir}/build/api"/>
9   <delete dir="${basedir}/build/code-browser"/>
10   <delete dir="${basedir}/build/coverage"/>
11   <delete dir="${basedir}/build/logs"/>
12   <delete dir="${basedir}/build/pdepend"/>
14   <mkdir dir="${basedir}/build/api"/>
15   <mkdir dir="${basedir}/build/code-browser"/>
16   <mkdir dir="${basedir}/build/coverage"/>
17   <mkdir dir="${basedir}/build/logs"/>
18   <mkdir dir="${basedir}/build/pdepend"/>
19  </target>
21  <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
22   <exec executable="phpunit">
23       <arg line="--configuration phpunit.xml.dist"/>
24   </exec>
25  </target>
27  <target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
28   <exec executable="phpunit">
29       <arg line="--configuration phpunit.xml.nocoverage"/>
30   </exec>
31  </target>
33  <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
34   <exec executable="pdepend">
35    <arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
36               '--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
37               '--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
38               ${source_comma_sep}" />
39   </exec>
40  </target>
42  <target name="phpmd" description="Generate pmd.xml using PHPMD">
43   <exec executable="phpmd">
44    <arg line="${source_comma_sep}
45               xml
46               codesize,design,naming,unusedcode
47               --exclude test,build,tcpdf,php-gettext,bfShapeFiles,PMAStandard,phpseclib,recaptchalib.php,swekey.php
48               --reportfile '${basedir}/build/logs/pmd.xml'" />
49   </exec>
50  </target>
52  <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
53   <exec executable="phpcpd">
54    <arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
55               --exclude test
56               --exclude PMAStandard
57               --exclude build
58               --exclude libraries/tcpdf
59               --exclude libraries/php-gettext
60               --exclude libraries/bfShapeFiles
61               --exclude libraries/phpseclib
62               --exclude libraries/plugins/auth/recaptchalib.php
63               --exclude libraries/plugins/auth/swekey/swekey.php
64               ${source}" />
65   </exec>
66  </target>
68  <target name="phploc" description="Generate phploc.csv">
69   <exec executable="phploc">
70    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
71               --exclude test
72               --exclude PMAStandard
73               --exclude build
74               --exclude libraries/tcpdf
75               --exclude libraries/php-gettext
76               --exclude libraries/bfShapeFiles
77               --exclude libraries/phpseclib
78               --exclude libraries/plugins/auth/recaptchalib.php
79               --exclude libraries/plugins/auth/swekey/swekey.php
80               ${source}" />
81   </exec>
82  </target>
84  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding test, tcpdf directories">
85   <exec executable="phpcs">
86    <arg line="
87               --ignore=*/php-gettext/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/PMAStandard/*,*/phpseclib/*,*/recaptchalib.php,*/swekey.php
88               --report=checkstyle
89               --report-file='${basedir}/build/logs/checkstyle.xml'
90               --standard=PMAStandard
91               ${source}" />
92   </exec>
93  </target>
95  <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
96   <exec executable="phpdoc">
97    <arg line="-d ${source} -t '${basedir}/build/api'" />
98   </exec>
99  </target>
101  <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
102   <exec executable="phpcb">
103    <arg line="--log    '${basedir}/build/logs'
104               --source '${source}'
105               --output '${basedir}/build/code-browser'" />
106   </exec>
107  </target>
109  <target name="jshint" description="Javascript checks">
110   <apply executable="jshint" output="${basedir}/build/logs/jslint.xml"  parallel="true">
111    <arg line="--config ./.jshintrc --jslint-reporter" />
112    <fileset dir="${basedir}">
113     <include name="js/pmd/*.js" />
114     <include name="js/*.js" />
115    </fileset>
116   </apply>
117  </target>
119  <target name="lint" description="Perform syntax check of sourcecode files">
120   <apply executable="php" failonerror="true">
121    <arg value="-l" />
123    <fileset dir="${basedir}">
124     <include name="**/*.php" />
125     <modified />
126    </fileset>
127   </apply>
128  </target>
130  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint"/>
131 </project>