Translated using Weblate (Slovenian)
[phpmyadmin.git] / build.xml
blob53f883123cd9d9fe600469f649a3faef03265bb1
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"/>
8  <property name="env.PHPUNIT_XML_NOCOVERAGE" value="phpunit.xml.nocoverage"/>
9  <property name="env.PHPUNIT_XML_HHVM" value="phpunit.xml.hhvm"/>
10  <property name="env.PHPUNIT_ARGS" value=""/>
12  <target name="clean" description="Clean up and create artifact directories">
13   <delete dir="${basedir}/build/api"/>
14   <delete dir="${basedir}/build/code-browser"/>
15   <delete dir="${basedir}/build/coverage"/>
16   <delete dir="${basedir}/build/logs"/>
17   <delete dir="${basedir}/build/pdepend"/>
19   <mkdir dir="${basedir}/build/api"/>
20   <mkdir dir="${basedir}/build/code-browser"/>
21   <mkdir dir="${basedir}/build/coverage"/>
22   <mkdir dir="${basedir}/build/logs"/>
23   <mkdir dir="${basedir}/build/pdepend"/>
24  </target>
26  <target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
27   <exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
28       <arg line="--configuration ${env.PHPUNIT_XML} ${env.PHPUNIT_ARGS}"/>
29   </exec>
30  </target>
32  <target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
33   <exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
34       <arg line="--configuration ${env.PHPUNIT_XML_NOCOVERAGE} ${env.PHPUNIT_ARGS}"/>
35   </exec>
36  </target>
38  <target name="phpunit-hhvm" description="Run unit tests using PHPUnit with HHVM specific config">
39   <exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
40       <arg line="--configuration ${env.PHPUNIT_XML_HHVM} ${env.PHPUNIT_ARGS}"/>
41   </exec>
42  </target>
44  <target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
45   <exec executable="pdepend">
46    <arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
47               '--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
48               '--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
49               ${source_comma_sep}" />
50   </exec>
51  </target>
53  <target name="phpmd" description="Generate pmd.xml using PHPMD">
54   <exec executable="phpmd">
55    <arg line="${source_comma_sep}
56               xml
57               codesize,design,naming,unusedcode
58               --exclude test,build,tcpdf,php-gettext,bfShapeFiles,phpseclib,recaptchalib.php,vendor,sql-parser
59               --reportfile '${basedir}/build/logs/pmd.xml'" />
60   </exec>
61  </target>
63  <target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
64   <exec executable="phpcpd">
65    <arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
66               --exclude test
67               --exclude build
68               --exclude vendor
69               --exclude libraries/tcpdf
70               --exclude libraries/php-gettext
71               --exclude libraries/bfShapeFiles
72               --exclude libraries/phpseclib
73               --exclude libraries/plugins/auth/recaptcha/recaptchalib.php
74               --exclude libraries/sql-parser
75               ${source}" />
76   </exec>
77  </target>
79  <target name="phploc" description="Generate phploc.csv">
80   <exec executable="phploc">
81    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
82               --exclude test
83               --exclude build
84               --exclude vendor
85               --exclude libraries/tcpdf
86               --exclude libraries/php-gettext
87               --exclude libraries/bfShapeFiles
88               --exclude libraries/phpseclib
89               --exclude libraries/plugins/auth/recaptcha/recaptchalib.php
90               --exclude libraries/sql-parser
91               ${source}" />
92   </exec>
93  </target>
95  <target name="phpcs-config" description="PHPCS configuration tweaking">
96   <exec executable="phpcs">
97    <arg line="--config-set installed_paths ${basedir}/vendor/phpmyadmin/coding-standard" />
98   </exec>
99  </target>
101  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
102   <exec executable="phpcs">
103    <arg line="
104               --ignore=*/php-gettext/*,*/vendor/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/phpseclib/*,*/recaptcha/*,*/sql-parser/*
105               --report=checkstyle
106               --extensions=php
107               --report-file='${basedir}/build/logs/checkstyle.xml'
108               --standard=PMAStandard
109               ${source}" />
110   </exec>
111  </target>
113  <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
114   <exec executable="phpdoc">
115    <arg line="-d ${source} -t '${basedir}/build/api'" />
116   </exec>
117  </target>
119  <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
120   <exec executable="phpcb">
121    <arg line="--log    '${basedir}/build/logs'
122               --source '${source}'
123               --output '${basedir}/build/code-browser'" />
124   </exec>
125  </target>
127 <target name="jshint" description="Javascript checks">
128   <apply executable="jshint" output="${basedir}/build/logs/jshint-jslint.xml"  parallel="true">
129    <arg line="--config ./.jshintrc --reporter=jslint" />
130    <fileset dir="${basedir}">
131     <include name="js/pmd/*.js" />
132     <include name="js/*.js" />
133     <include name="setup/*.js" />
134    </fileset>
135   </apply>
136  </target>
138  <target name="jshint-checkstyle" description="Javascript checks">
139   <apply executable="jshint" output="${basedir}/build/logs/jshint-checkstyle.xml"  parallel="true">
140    <arg line="--config ./.jshintrc --reporter=checkstyle" />
141    <fileset dir="${basedir}">
142     <include name="js/pmd/*.js" />
143     <include name="js/*.js" />
144     <include name="setup/*.js" />
145    </fileset>
146   </apply>
147  </target>
149  <target name="locales" description="Generate locales">
150    <exec executable="./scripts/generate-mo" failonerror="true">
151      <arg line="--quiet" />
152    </exec>
153  </target>
155  <target name="lint" description="Perform syntax check of sourcecode files">
156   <apply executable="php" failonerror="true">
157    <arg value="-l" />
159    <fileset dir="${basedir}">
160     <include name="libraries/**/*.php" />
161     <include name="templates/**/*.phtml" />
162     <include name="setup/**/*.php" />
163     <include name="test/**/*.php" />
164     <include name="*.php" />
165     <modified />
166    </fileset>
167   </apply>
168  </target>
170  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint,locales"/>
171 </project>