forked from ruflin/Elastica
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·155 lines (139 loc) · 4.4 KB
/
build.xml
File metadata and controls
executable file
·155 lines (139 loc) · 4.4 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0" encoding="UTF-8"?>
<project name="Elastica" default="build" basedir=".">
<property name="source" value="${basedir}/lib"/>
<target name="clean">
<!-- Clean up -->
<delete dir="build"/>
<!-- Create build directories -->
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="phpunit" depends="clean">
<exec executable="phpunit" dir="${basedir}/test" failonerror="off" />
</target>
<!-- Run pdepend, phpmd, phpcpd, and phpcs in parallel -->
<target name="parallelTasks">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<antcall target="phpdoc"/>
<antcall target="phpcb"/>
</parallel>
</target>
<!-- Generate jdepend.xml and software metrics charts -->
<target name="pdepend">
<exec executable="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${source}" />
</exec>
</target>
<!-- Generate pmd.xml -->
<target name="phpmd">
<exec executable="phpmd">
<arg path="${source}" />
<arg value="xml" />
<arg value="codesize,unusedcode,naming,design" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>
<!-- Generate pmd-cpd.xml -->
<target name="phpcpd">
<exec executable="phpcpd">
<arg line="--log-pmd ${basedir}/build/logs/pmd-cpd.xml ${source}" />
</exec>
</target>
<!-- Generate checkstyle.xml -->
<target name="phpcs">
<exec executable="phpcs" output="/dev/null">
<arg line="--report=checkstyle --report-file=${basedir}/build/logs/checkstyle.xml --standard=${basedir}/test/CodeSniffer/Standards/Xodoa ${source}" />
</exec>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${source}" />
</exec>
</target>
<!-- Generate API documentation -->
<target name="phpdoc">
<exec executable="phpdoc">
<arg line="--directory ${source} --target ${basedir}/build/api" />
</exec>
</target>
<target name="phpcb">
<exec executable="phpcb">
<arg line="--log ${basedir}/build/logs
--source ${source}
--output ${basedir}/build/code-browser" />
</exec>
</target>
<target name="build" depends="clean,parallelTasks,phpunit"/>
<!-- Checkstyle with human output -->
<target name="codesniffer">
<exec executable="phpcs">
<arg line="--standard=${basedir}/test/CodeSniffer/Standards/Xodoa ${source}" />
</exec>
</target>
<!-- Setups test environment -->
<target name="setup" description="setups php libs for">
<exec executable="pear">
<arg line="channel-discover pear.pdepend.org" />
</exec>
<exec executable="pear">
<arg line="channel-discover pear.phpmd.org" />
</exec>
<exec executable="pear">
<arg line="channel-discover pear.phpunit.de" />
</exec>
<exec executable="pear">
<arg line="channel-discover components.ez.no" />
</exec>
<exec executable="pear">
<arg line="channel-discover pear.symfony-project.com" />
</exec>
<exec executable="pear">
<arg line="install pdepend/PHP_Depend" />
</exec>
<exec executable="pear">
<arg line="install phpmd/PHP_PMD" />
</exec>
<exec executable="pear">
<arg line="install phpunit/phpcpd" />
</exec>
<exec executable="pear">
<arg line="install phpunit/phploc" />
</exec>
<exec executable="pear">
<arg line="install PHPDocumentor" />
</exec>
<exec executable="pear">
<arg line="install PHP_CodeSniffer" />
</exec>
<exec executable="pear">
<arg line="install --alldeps phpunit/PHP_CodeBrowser" />
</exec>
<exec executable="pear">
<arg line="install --alldeps phpunit/PHPUnit" />
</exec>
</target>
<target name="gource" description="Visualize repos with gource">
<exec executable="gource">
<arg line="--log-format git" />
<arg line="--seconds-per-day 0.1" />
<arg line="--title 'Elastica (https://github.com/ruflin/Elastica)'" />
<arg line="--user-scale 1" />
<arg line="--max-user-speed 50" />
</exec>
</target>
</project>