-
Notifications
You must be signed in to change notification settings - Fork 148
/
build.xml
131 lines (106 loc) · 4.94 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="UTF-8"?>
<!--
Build file contains the hand-crafted targets to run various tools from PHP Quality Assurance Toolchain project.
We do not use tasks built into Phing, because they have no real control over filesets to check
and work only with globally-installed executables. We, on the other hand, install everything in `vendor/` and `bin/`.
By running `bin/phing` without specifying targets, you get the API documentation, code coverage and a set of reports
regarding code quality, all inside the `reports` directory.
-->
<project name="Boilerplate"
default="all"
description="Boilerplate for a web application, fully prepared for real work.">
<import file="carcass/filesets.xml" />
<target name="all" depends="doc, check" />
<target name="doc" depends="apigen" />
<target name="check" depends="phploc, coverage, pdepend, phpcpd, phpmd, phpcs, codebrowser" />
<target name="phploc" depends="prepare-reports-dir">
<exec executable="bin/phploc" dir="." passthru="true">
<arg value="--verbose" />
<arg value="--progress" />
<arg value="--exclude" />
<arg value="config" />
<arg value="--exclude" />
<arg value="lib" />
<arg value="--exclude" />
<arg value="extensions" />
<arg value="--exclude" />
<arg value="runtime" />
<arg value="--exclude" />
<arg value="www" />
<arg value="--log-xml" />
<arg value="reports/phploc.xml" />
<!-- This "line" instead of "value" is extremely important, it allows us to specify several tokens as an argument -->
<arg line="${fileset.sources.phploc}" />
</exec>
</target>
<target name="prepare-reports-dir">
<mkdir dir="reports" />
</target>
<target name="pdepend" depends="prepare-reports-dir">
<exec executable="bin/pdepend" dir="." passthru="true">
<arg value="--ignore=config,lib,extensions,runtime,views,www,migrations/template" />
<!-- Note that this option is for INPUT file, not GENERATED one! -->
<arg value="--coverage-report=reports/clover.xml" />
<arg value="--summary-xml=reports/pdepend.xml" />
<arg value="--jdepend-chart=reports/jdepend.svg" />
<arg value="--overview-pyramid=reports/overview.svg" />
<arg value="${fileset.sources.pdepend}" />
</exec>
</target>
<target name="coverage" depends="prepare-reports-dir">
<delete dir="reports/coverage" />
<exec executable="bin/phpunit" dir="." passthru="true">
<arg value="--coverage-clover" />
<arg value="reports/clover.xml" />
<arg value="--coverage-html" />
<arg value="reports/coverage" />
</exec>
</target>
<target name="phpmd" depends="prepare-reports-dir">
<exec executable="bin/phpmd" dir="." passthru="true">
<arg value="--reportfile" />
<arg value="reports/phpmd.xml" />
<arg value="--exclude" />
<arg value="config,lib,extensions,runtime,views,www,migrations" />
<arg value="${fileset.sources.phpmd}" />
<arg value="xml" />
<arg value="carcass/phpmd.xml" />
</exec>
</target>
<!-- We deliberately do not exclude anything to get duplication not necessarily in class definitions -->
<target name="phpcpd" depends="prepare-reports-dir">
<exec executable="bin/phpcpd" dir="." passthru="true">
<arg value="--log-pmd" />
<arg value="reports/phpcpd.xml" />
<arg value="--min-lines" />
<arg value="4" />
<arg value="--fuzzy" />
<arg value="--progress" />
<arg line="${fileset.sources.phpcpd}" />
</exec>
</target>
<target name="phpcs" depends="prepare-reports-dir">
<exec executable="bin/phpcs" dir="." passthru="true">
<arg value="--extensions=php" />
<!-- Tab-width param is quite important, phpcs will treat tabs as single spaces without it. -->
<arg value="--tab-width=4" />
<arg value="--standard=carcass/ruleset.xml" />
<arg value="--report-checkstyle=reports/checkstyle.xml" />
<arg line="${fileset.sources.phpcs}" />
</exec>
</target>
<target name="codebrowser" depends="prepare-reports-dir">
<exec executable="bin/phpcb" dir="." passthru="true">
<arg value="--log=reports" />
<arg value="--extensions=php" />
<arg value="--output=reports/codebrowser" />
</exec>
</target>
<target name="apigen" depends="prepare-reports-dir">
<exec executable="bin/apigen.php" dir="." passthru="true">
<arg value="--config" />
<arg value="carcass/apigen.cfg" />
<arg line="${fileset.sources.apigen}" />
</exec>
</target>
</project>