Translated using Weblate (Estonian)
[phpmyadmin.git] / build.xml
blob445b863d8944c3d5aae01d5929805f7b827ab5ee
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="--exclude-group selenium"/>
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,vendor,tmp
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 tmp
68               --exclude build
69               --exclude vendor
70               ${source}" />
71   </exec>
72  </target>
74  <target name="phploc" description="Generate phploc.csv">
75   <exec executable="phploc">
76    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
77               --exclude test
78               --exclude build
79               --exclude vendor
80               --exclude tmp
81               ${source}" />
82   </exec>
83  </target>
85  <target name="phpcs-config" description="PHPCS configuration tweaking">
86   <exec executable="${basedir}/vendor/bin/phpcs">
87    <arg line="--config-set installed_paths ${basedir}/vendor/phpmyadmin/coding-standard" />
88   </exec>
89  </target>
91  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
92   <exec executable="${basedir}/vendor/bin/phpcs">
93    <arg line="
94               --ignore=*/vendor/*,*/build/*,*/tmp/*
95               --report=checkstyle
96               --extensions=php
97               --report-file='${basedir}/build/logs/checkstyle.xml'
98               --standard=PMAStandard
99               ${source}" />
100   </exec>
101  </target>
103  <target name="phpdoc" description="Generate API documentation using PHPDocumentor">
104   <exec executable="phpdoc">
105    <arg line="-d ${source} -t '${basedir}/build/api'" />
106   </exec>
107  </target>
109  <target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
110   <exec executable="phpcb">
111    <arg line="--log    '${basedir}/build/logs'
112               --source '${source}'
113               --output '${basedir}/build/code-browser'" />
114   </exec>
115  </target>
117 <target name="jshint" description="Javascript checks">
118   <apply executable="jshint" output="${basedir}/build/logs/jshint-jslint.xml"  parallel="true">
119    <arg line="--config ./.jshintrc --reporter=jslint" />
120    <fileset dir="${basedir}">
121     <include name="js/designer/*.js" />
122     <include name="js/*.js" />
123     <include name="setup/*.js" />
124    </fileset>
125   </apply>
126  </target>
128  <target name="jshint-checkstyle" description="Javascript checks">
129   <apply executable="jshint" output="${basedir}/build/logs/jshint-checkstyle.xml"  parallel="true">
130    <arg line="--config ./.jshintrc --reporter=checkstyle" />
131    <fileset dir="${basedir}">
132     <include name="js/designer/*.js" />
133     <include name="js/*.js" />
134     <include name="setup/*.js" />
135    </fileset>
136   </apply>
137  </target>
139  <target name="locales" description="Generate locales">
140    <exec executable="./scripts/generate-mo" failonerror="true">
141      <arg line="--quiet" />
142    </exec>
143  </target>
145  <target name="lint" description="Perform syntax check of sourcecode files">
146   <apply executable="php" failonerror="true">
147    <arg value="-l" />
149    <fileset dir="${basedir}">
150     <include name="libraries/**/*.php" />
151     <include name="templates/**/*.phtml" />
152     <include name="setup/**/*.php" />
153     <include name="test/**/*.php" />
154     <include name="*.php" />
155     <modified />
156    </fileset>
157   </apply>
158  </target>
160  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint,locales"/>
161 </project>