This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
88 lines (70 loc) · 3.51 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<project default="build">
<property name="builddir" value="./build" override="true" />
<property name="coveragedir" value="${builddir}/coverage" override="true" />
<fileset id="allCode" dir="${project.basedir}">
<include name="src/**" />
<include name="tests/**" />
</fileset>
<target name="build" depends="prepare,phpunit,behat,phpcs,pdepend,phpmd,phpcpd,phploc,phpdox" description="Build the project">
</target>
<target name="prepare" depends="composer,cleanup">
<echo msg="Making directory ${builddir}" />
<mkdir dir="${builddir}" />
<mkdir dir="${builddir}/phpunit/" />
<mkdir dir="${builddir}/behat/" />
<mkdir dir="${builddir}/phpcs/" />
<mkdir dir="${builddir}/pdepend/" />
<mkdir dir="${builddir}/phpmd/" />
<mkdir dir="${builddir}/phpcpd/" />
<mkdir dir="${builddir}/phploc/" />
</target>
<target name="cleanup">
<echo msg="Removing directory ${builddir}" />
<delete dir="${builddir}" />
</target>
<target name="composer" description="Run composer install">
<composer command="install" composer="/usr/local/bin/composer">
<arg value="--optimize-autoloader" />
</composer>
<!-- Load autoload.php so apps installed with composer works -->
<php expression="include('vendor/autoload.php')"/>
</target>
<target name="phpunit" description="Run the unit tests" depends="prepare">
<exec command="./vendor/bin/phpunit -c phpunitCI.xml" checkreturn="true" />
</target>
<target name="behat" description="Run Behat tests" depends="prepare">
<exec command="./vendor/bin/behat --format=junit,html,pretty --out ${builddir}/behat/,${builddir}/behat/behat.html,"
checkreturn="true"
/>
</target>
<target name="phpcs" description="Run phpcs to check the coding standards" depends="prepare">
<phpcodesniffer standard="PSR2">
<fileset refid="allCode" />
<formatter type="checkstyle" outfile="${builddir}/phpcs/checkstyle.xml"/>
<formatter type="xml" outfile="${builddir}/phpcs/phpcs.xml"/>
</phpcodesniffer>
</target>
<target name="pdepend" description="Run jdepend" depends="prepare">
<exec command="./vendor/bin/pdepend --jdepend-xml=${builddir}/pdepend/pdepend.xml --summary-xml=${builddir}/pdepend/summary.xml --jdepend-chart=${builddir}/pdepend/chart.svg --overview-pyramid=${builddir}/pdepend/pyramid.svg src"
checkreturn="true"
/>
</target>
<target name="phpmd" description="Run phpmd to detect code smells" depends="prepare">
<exec command="./vendor/bin/phpmd src,tests xml cleancode,codesize,controversial,design,naming,unusedcode --reportfile ${builddir}/phpmd/phpmd.xml"
/>
</target>
<target name="phpcpd" description="Run PHP Copy Paste Detector" depends="prepare">
<phpcpd minTokens="35">
<fileset refid="allCode" />
<formatter type="pmd" outfile="${builddir}/phpcpd/phpcpd.xml"/>
</phpcpd>
</target>
<target name="phploc" description="Run phploc to extract some metrics from the code" depends="prepare">
<exec command="./vendor/bin/phploc --count-tests --log-xml=build/phploc/phploc.xml src tests"
checkreturn="true"
/>
</target>
<target name="phpdox" description="Generate documentation with phpdox" depends="prepare,phploc,phpcs,phpmd,phpunit">
<exec command="./vendor/bin/phpdox" />
</target>
</project>