-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
259 lines (239 loc) · 10.8 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by PHP Project Wizard (PPW) 1.0.4 on Fri Aug 26 11:02:43 PDT 2011 -->
<project name="simplecart" default="build" basedir=".">
<property name="source" value="src"/>
<!-- Add Custom Tasks to the include path -->
<includepath classpath="scripts/tasks/closure/tasks" />
<taskdef name="yuicompressor" classname="YuiCompressorTask" />
<taskdef name="closure" classname="ClosureTask" />
<target name="clean" depends="clear-cache" description="Clean up and create artifact directories">
<delete dir="build/api"/>
<delete dir="build/code-browser"/>
<delete dir="build/coverage"/>
<delete dir="build/logs"/>
<delete dir="build/pdepend"/>
<mkdir dir="build/api"/>
<mkdir dir="build/code-browser"/>
<mkdir dir="build/coverage"/>
<mkdir dir="build/logs"/>
<mkdir dir="build/pdepend"/>
</target>
<target name="clear-cache" description="Clears cache folders">
<delete dir="src/system/cache" includeemptydirs="false" failonerror="true" />
<mkdir dir="src/system/cache"/>
<chmod file="src/system/cache" mode="0777" />
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<coverage-setup database="build/coverage/coverage.db">
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<include name="library/SimpleCart/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
</coverage-setup>
<delete dir="tests/data/cache" includeemptydirs="false" failonerror="true" />
<mkdir dir="tests/data/cache"/>
<chmod file="tests/data/cache" mode="0777" />
<phpunit haltonerror="false" bootstrap="tests/unit/bootstrap.php" codecoverage="true" >
<formatter type="clover" todir="build/logs" outfile="clover.xml"></formatter>
<formatter type="xml" todir="build/logs" outfile="junit.xml"></formatter>
<batchtest>
<fileset dir="tests/unit">
<include name="**/*Test*.php"/>
<exclude name="bootstrap.php"/>
</fileset>
</batchtest>
</phpunit>
<coverage-report outfile="build/logs/coverage.xml">
<report todir="build/coverage" styledir="scripts/phing"/>
</coverage-report>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<phpdepend>
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
<logger type="jdepend-xml" outfile="build/logs/jdepend.xml"/>
<logger type="jdepend-chart" outfile="build/pdepend/dependencies.svg"/>
<logger type="overview-pyramid" outfile="build/pdepend/overview-pyramid.svg"/>
</phpdepend>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<phpmd rulesets="codesize,design,naming,unusedcode">
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
<formatter type="xml" outfile="build/logs/pmd.xml"/>
</phpmd>
</target>
<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<phpcpd>
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
<formatter type="pmd" outfile="build/logs/pmd-cpd.xml"/>
</phpcpd>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec command="phploc --log-csv build/logs/phploc.csv ${source}/system"/>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<phpcodesniffer standard="simplecart" showWarnings="false">
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
<formatter type="default" usefile="false"/>
<formatter type="checkstyle" outfile="build/logs/checkstyle.xml"/>
</phpcodesniffer>
</target>
<target name="phpdoc" description="Generate API documentation using PHPDocumentor">
<phpdoc destdir="build/api" parseprivate="false" output="HTML:Smarty:PHP">
<fileset dir="${source}/system">
<include name="forms/**.php" />
<include name="models/**.php" />
<include name="library/**.php" />
<exclude name="library/Doctrine.php" />
<exclude name="library/Doctrine/*" />
<exclude name="library/Zend/*" />
<exclude name="library/ZendX/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Kint/*" />
<exclude name="library/Kint.php" />
<exclude name="library/sfEventDispatcher/*" />
<exclude name="library/sfYaml/*" />
<exclude name="library/WideImage/*" />
<exclude name="library/WideImage.php" />
<exclude name="library/ZFDebug/*" />
<exclude name="library/Danceric/*" />
<exclude name="library/Imind/*" />
<exclude name="library/HTMLPurifier.php" />
<exclude name="library/HTMLPurifier/*" />
</fileset>
<projdocfileset dir="${project.basedir}">
<include name="README" />
<include name="INSTALL" />
</projdocfileset>
</phpdoc>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec command="phpcb --log build/logs --source ${source}/system --output build/code-browser" />
</target>
<target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb"/>
<target name="cssmin" description="Combines and compresses css files">
<echo message="Combine CSS Files" />
<delete file="${source}/public_html/assets/styles/admin.min.css"/>
<delete dir="build/tmp"/>
<mkdir dir="build/tmp"/>
<append destfile="build/tmp/admin.min.css">
<filelist dir="${source}/public_html/assets" listfile="${source}/public_html/assets/styles/admin.txt"/>
</append>
<echo message="Compress combined css file"/>
<yuicompressor target="${source}/public_html/assets/styles" type="css" compressorjar="${project.basedir}/scripts/tasks/yuicompressor/yuicompressor.jar" verbose="true">
<filelist dir="build/tmp" files="admin.min.css"></filelist>
</yuicompressor>
<delete dir="build/tmp"/>
</target>
<target name="jsmin" description="Combines and compresses javascript files">
<echo message="Combine CSS Files" />
<delete file="${source}/public_html/assets/scripts/admin.min.js"/>
<delete dir="build/tmp"/>
<mkdir dir="build/tmp"/>
<append destfile="build/tmp/admin.min.js">
<filelist dir="${source}/public_html/assets" listfile="${source}/public_html/assets/scripts/admin.txt"/>
</append>
<echo message="Compress combined js file"/>
<yuicompressor target="${source}/public_html/assets/scripts" type="js" compressorjar="${project.basedir}/scripts/tasks/yuicompressor/yuicompressor.jar" verbose="true">
<filelist dir="build/tmp" files="admin.min.js"></filelist>
</yuicompressor>
<delete dir="build/tmp"/>
</target>
</project>