Translated using Weblate (Slovenian)
[phpmyadmin.git] / build.xml
blobea6c9700560b4dc8a7f14dcb6a296429a020606c
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_ARGS" value="--exclude-group selenium"/>
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="${basedir}/vendor/bin/phpunit" failonerror="true">
26       <arg line="--configuration ${env.PHPUNIT_XML} ${env.PHPUNIT_ARGS}"/>
27   </exec>
28  </target>
30  <target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
31   <exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
32       <arg line="--configuration --no-coverage ${env.PHPUNIT_ARGS}"/>
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,vendor,tmp
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 tmp
60               --exclude build
61               --exclude vendor
62               ${source}" />
63   </exec>
64  </target>
66  <target name="phploc" description="Generate phploc.csv">
67   <exec executable="phploc">
68    <arg line="--log-csv '${basedir}/build/logs/phploc.csv'
69               --exclude test
70               --exclude build
71               --exclude vendor
72               --exclude tmp
73               ${source}" />
74   </exec>
75  </target>
77  <target name="phpcs-config" description="PHPCS configuration tweaking">
78   <exec executable="${basedir}/vendor/bin/phpcs">
79    <arg line="--config-set installed_paths ${basedir}/vendor/phpmyadmin/coding-standard" />
80   </exec>
81  </target>
83  <target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
84   <exec executable="${basedir}/vendor/bin/phpcs">
85    <arg line="
86               --ignore=*/vendor/*,*/build/*,*/tmp/*
87               --report=checkstyle
88               --extensions=php
89               --report-file='${basedir}/build/logs/checkstyle.xml'
90               --standard=PhpMyAdmin
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/jshint-jslint.xml"  parallel="true">
111    <arg line="--config ./.jshintrc --reporter=jslint" />
112    <fileset dir="${basedir}">
113     <include name="js/designer/*.js" />
114     <include name="js/*.js" />
115     <include name="setup/*.js" />
116    </fileset>
117   </apply>
118  </target>
120  <target name="jshint-checkstyle" description="Javascript checks">
121   <apply executable="jshint" output="${basedir}/build/logs/jshint-checkstyle.xml"  parallel="true">
122    <arg line="--config ./.jshintrc --reporter=checkstyle" />
123    <fileset dir="${basedir}">
124     <include name="js/designer/*.js" />
125     <include name="js/*.js" />
126     <include name="setup/*.js" />
127    </fileset>
128   </apply>
129  </target>
131  <target name="locales" description="Generate locales">
132    <exec executable="./scripts/generate-mo" failonerror="true">
133      <arg line="--quiet" />
134    </exec>
135  </target>
137  <target name="lint" description="Perform syntax check of sourcecode files">
138   <apply executable="php" failonerror="true">
139    <arg value="-l" />
141    <fileset dir="${basedir}">
142     <include name="libraries/**/*.php" />
143     <include name="templates/**/*.phtml" />
144     <include name="setup/**/*.php" />
145     <include name="test/**/*.php" />
146     <include name="*.php" />
147     <modified />
148    </fileset>
149   </apply>
150  </target>
152  <target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,jshint,locales"/>
153 </project>