forked from aimeos/aimeos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
321 lines (286 loc) · 13.7 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="UTF-8"?>
<project name="Aimeos" default="all">
<property name="coredir" value="${project.basedir}" override="false" />
<property name="extdir" value="${project.basedir}/ext" override="false" />
<property name="bindir" value="${project.basedir}/vendor/bin/" override="false" />
<target name="setup" description="Sets up database incl. unit test data">
<echo msg="Setting up test database" />
<exec command="php ${coredir}/setup.php unittest unittest" checkreturn="true" logoutput="true" passthru="true" />
</target>
<target name="setupperf" description="Sets up database incl. performance test data">
<echo msg="Setting up performance data" />
<exec command="php ${coredir}/setup.php unitperf unitperf" checkreturn="true" logoutput="true" passthru="true" />
</target>
<target name="coverage" description="Creates coverage reports">
<phing target="coverage" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="coverage" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="coverage" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="coverageext" description="Creates coverage report for specific extension directory">
<phing target="coverage" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="test" description="Executes unit tests">
<phing target="test" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="test" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="test" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="test" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="test" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="testperf" description="Executes performance tests">
<phing target="testperf" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="testperf" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="testperf" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="testext" description="Executes tests of specific extension directory">
<phing target="test" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="testextperf" description="Executes tests of specific extension directory">
<phing target="testperf" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="check" description="Executes all checks">
<property name="codestddir" value="${project.basedir}/misc/coding" override="true" />
<phing target="check" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="check" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="check" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="check" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="check" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="checkext" description="Executes checks of specific extension directory">
<property name="codestddir" value="${project.basedir}/misc/coding" override="true" />
<phing target="check" haltonfailure="true" dir="${dir}" phingfile="phing.xml" />
</target>
<target name="doc" description="Generates the documentation" depends="test">
<taskdef name="confdoc" classname="MShopConfigDocTask" classpath="${coredir}/misc/phing" />
<mkdir dir="${coredir}/misc/confdoc/" />
<echo msg="Generating config documentation" />
<confdoc prefix="madmin" keyparts="2"
optfile="${coredir}/lib/mshoplib/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${coredir}/lib/mshoplib/src/MAdmin" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="mshop" keyparts="2"
optfile="${coredir}/lib/mshoplib/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${coredir}/lib/mshoplib/src/MShop" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
<fileset dir="${extdir}/ai-fosuser/lib/custom/src/MShop" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
<fileset dir="${extdir}/ai-laravel/lib/custom/src/MShop" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
<fileset dir="${extdir}/ai-typo3/lib/custom/src/MShop" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/common" keyparts="1"
optfile="${coredir}/controller/common/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${coredir}/controller/common/src" expandsymboliclinks="true" >
<include name="**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/jobs" keyparts="1"
optfile="${coredir}/controller/jobs/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${coredir}/controller/jobs" expandsymboliclinks="true" >
<include name="src/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="admin/jqadm" keyparts="1"
optfile="${extdir}/ai-admin-jqadm/admin/jqadm/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-admin-jqadm" expandsymboliclinks="true" >
<include name="admin/jqadm/templates/**/*.php" />
<include name="admin/jqadm/src/**/*.php" />
<include name="config/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="admin/jsonadm" keyparts="1"
optfile="${extdir}/ai-admin-jsonadm/admin/jsonadm/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-admin-jsonadm" expandsymboliclinks="true" >
<include name="admin/jsonadm/templates/**/*.php" />
<include name="admin/jsonadm/src/**/*.php" />
<include name="config/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="client/html" keyparts="2"
optfile="${extdir}/ai-client-html/client/html/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-client-html" expandsymboliclinks="true" >
<include name="client/html/templates/**/*.php" />
<include name="client/html/src/**/*.php" />
<include name="config/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="client/jsonapi" keyparts="1"
optfile="${extdir}/ai-client-jsonapi/client/jsonapi/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-client-jsonapi/client/jsonapi" expandsymboliclinks="true" >
<include name="templates/**/*.php" />
<include name="src/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/common" keyparts="2"
optfile="${extdir}/ai-controller-jobs/controller/common/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-controller-jobs" expandsymboliclinks="true" >
<include name="controller/common/src/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/common" keyparts="2"
optfile="${extdir}/ai-controller-jobs/controller/jobs/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-controller-jobs" expandsymboliclinks="true" >
<include name="controller/jobs/templates/**/*.php" />
<include name="controller/jobs/src/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/jobs" keyparts="2"
optfile="${extdir}/ai-client-html/controller/jobs/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-client-html/controller/jobs" expandsymboliclinks="true" >
<include name="templates/**/*.php" />
<include name="src/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/jobs" keyparts="2"
optfile="${extdir}/ai-controller-jobs/controller/jobs/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-controller-jobs" expandsymboliclinks="true" >
<include name="controller/jobs/templates/**/*.php" />
<include name="controller/jobs/src/**/*.php" />
<include name="config/**/*.php" />
</fileset>
</confdoc>
<confdoc prefix="controller/frontend" keyparts="1"
optfile="${extdir}/ai-controller-frontend/controller/frontend/tests/confdoc.ser"
outdir="${coredir}/misc/confdoc">
<fileset dir="${extdir}/ai-controller-frontend" expandsymboliclinks="true" >
<include name="controller/frontend/src/**/*.php" />
<include name="config/**/*.php" />
</fileset>
</confdoc>
</target>
<target name="api" description="Generates the API documentation">
<delete dir="${coredir}/misc/apidoc" quiet="true" failonerror="false" />
<exec command="php ${coredir}/vendor/bin/apigen generate --template-theme=bootstrap
--title='Aimeos Core API documentation' --tree --no-source-code -d misc/apidoc
-s controller/common/src/ -s controller/jobs/src/
-s lib/mshoplib/src/ -s lib/mwlib/src/
-s ext/ai-admin-jqadm/admin/jqadm/src/
-s ext/ai-admin-jsonadm/admin/jsonadm/src/
-s ext/ai-client-html/client/html/src/ -s ext/ai-client-html/controller/jobs/src/
-s ext/ai-client-jsonapi/client/jsonapi/src/
-s ext/ai-controller-frontend/controller/frontend/src/
-s ext/ai-controller-jobs/controller/common/src/ -s ext/ai-controller-jobs/controller/jobs/src/"
checkreturn="true" logoutput="true" passthru="true" />
</target>
<target name="clean" description="Cleans up temporary files">
<delete dir="${coredir}/misc/apidoc" quiet="true" failonerror="false" />
<phing target="clean" haltonfailure="true" dir="${coredir}/lib/mwlib" />
<phing target="clean" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="clean" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="clean" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="clean" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="i18n" description="Creates all translation files">
<phing target="i18n" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="i18n" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="i18n" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="i18n" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="build" description="Creates all files to be generated" >
<exec command="tx pull -a -f --minimum-perc=1" checkreturn="true" logoutput="true" passthru="true" />
<foreach param="po-fname" absparam="po-filename" target="build-mo">
<fileset dir="./i18n">
<include name="**/*.po" />
</fileset>
</foreach>
<phing target="build" haltonfailure="true" dir="${coredir}/lib/mshoplib" />
<phing target="build" haltonfailure="true" dir="${coredir}/controller/common" />
<phing target="build" haltonfailure="true" dir="${coredir}/controller/jobs" />
<phing target="build" haltonfailure="true">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="build-mo" description="Generates binary translation files">
<fail unless="po-filename" message="Missing file name" />
<echo msg="File: ${po-filename}" />
<exec command="msgfmt --statistics -c -o `echo ${po-filename} | sed s/\.po//` ${po-filename}" checkreturn="true" logoutput="true" passthru="true" />
</target>
<target name="release" description="Creates new release" depends="build">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<exec command="git branch ${version}" checkreturn="true" logoutput="true" passthru="true" />
<exec command="git tag -a ${version}.1 -m 'Release ${version}.1'" checkreturn="true" logoutput="true" passthru="true" />
<exec command="git push origin ${version}" checkreturn="true" logoutput="true" passthru="true" />
<exec command="git push --tags" checkreturn="true" logoutput="true" passthru="true" />
</target>
<target name="releaseext" description="Creates new releases of the extensions">
<propertyprompt propertyName="version" promptText="Enter release version" promptCharacter=":" useExistingValue="true"/>
<phing target="release">
<fileset dir="${extdir}" expandsymboliclinks="true" >
<exclude name=".*/phing.xml" />
<include name="*/phing.xml" />
</fileset>
</phing>
</target>
<target name="createext" description="Creates new extension">
<propertyprompt propertyName="extname" promptText="Enter extension name (only A-Z, a-z, 0-9 and -)" promptCharacter=":" useExistingValue="true"/>
<copy todir="${extdir}/${extname}" >
<fileset dir="${coredir}/misc/ext-template">
<include name="**" />
</fileset>
</copy>
<reflexive>
<fileset dir="${extdir}/${extname}">
<include name="**" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<extname>" replace="${extname}"/>
</replaceregexp>
</filterchain>
</reflexive>
</target>
<target name="all" depends="setup,test,check" description="Executes all essential targets for testing" />
</project>