forked from shopsys/shopsys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
271 lines (254 loc) · 13.9 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Shopsys Framework" default="list">
<property name="path.root" value="./project-base"/>
<property name="path.vendor" value="./vendor"/>
<property name="path.packages" value="./packages"/>
<property name="path.microservices" value="./microservices"/>
<property name="path.bin-console" value="./project-base/bin/console"/>
<property name="path.framework" value="${path.packages}/framework"/>
<import file="project-base/build-dev.xml" />
<import file="project-base/build.xml" />
<target name="composer-dev" description="Installs dependencies for development if composer.lock is valid, otherwise runs composer update.">
<exec executable="${path.composer.executable}" returnProperty="composer.validate.returnCode">
<arg value="validate" />
<arg value="--no-check-all" />
<arg value="--no-check-publish" />
</exec>
<if>
<equals arg1="${composer.validate.returnCode}" arg2="0"/>
<then>
<echo message="The lock file is valid, installing dependencies..."/>
<property name="composer.action" value="install"/>
</then>
<else>
<echo message="The lock file is invalid, updating dependencies..."/>
<property name="composer.action" value="update"/>
</else>
</if>
<exec executable="${path.composer.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg value="${composer.action}"/>
</exec>
<phingcall target="composer-check" />
</target>
<target name="standards" depends="phplint,ecs,phpstan,twig-lint,yaml-lint,eslint-check,standards-packages" description="Checks coding standards in the project-base, packages and microservices."/>
<target name="standards-diff" depends="phplint-diff,ecs-diff,phpstan,twig-lint-diff,yaml-lint,eslint-check-diff,standards-packages" description="Checks coding standards on changed files in the project-base, packages and microservices."/>
<target name="clean" description="Cleans up directories with cache and scripts which are generated on demand.">
<delete failonerror="false" includeemptydirs="true">
<fileset dir="${path.var}/cache/">
<exclude name="/" />
</fileset>
<fileset dir="${path.web.scripts}/">
<exclude name="/" />
</fileset>
</delete>
<delete failonerror="false" includeemptydirs="true" quiet="true">
<filelist dir="${path.root}" files="migrations-lock.yml"/>
</delete>
</target>
<target name="standards-fix" description="Automatically fixes some coding standards violations in the project-base, packages and microservices.">
<phingcall target="ecs-fix" />
<phingcall target="eslint-fix" />
<phingcall target="standards-fix-packages" />
</target>
<target name="standards-fix-diff" description="Automatically fixes some coding standards violations in changed files in project-base and all files in packages and microservices.">
<phingcall target="ecs-fix-diff" />
<phingcall target="eslint-fix-diff" />
<phingcall target="standards-fix-packages-diff" />
</target>
<target name="standards-packages" description="Checks coding standards in all packages and microservices.">
<exec executable="${path.phplint.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg path="./packages/*/src"/>
<arg path="./microservices/*/src"/>
<arg path="./packages/*/tests" />
<arg path="./microservices/*/tests"/>
</exec>
<exec executable="${path.ecs.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg value="check" />
<arg value="--verbose" />
<arg path="./packages/*/src"/>
<arg path="./microservices/*/src"/>
<arg path="./packages/*/tests" />
<arg path="./microservices/*/tests"/>
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="lint:twig" />
<arg value="@ShopsysFrameworkBundle" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="lint:yaml" />
<arg value="@ShopsysFrameworkBundle" />
<arg value="--parse-tags" />
</exec>
<exec executable="${path.eslint.executable}" passthru="true" checkreturn="true">
<arg value="--color" />
<arg path="${path.framework}/src/Resources/scripts" />
<arg value="--config" />
<arg path="${path.framework}/.eslintrc.json" />
<arg value="--ignore-path" />
<arg path="${path.framework}/.eslintignore" />
</exec>
</target>
<target name="standards-fix-packages" description="Automatically fixes some coding standards violations in all packages and microservices.">
<exec executable="${path.ecs.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg value="check" />
<arg value="--clear-cache" />
<arg value="--fix" />
<arg value="--verbose" />
<arg path="./packages/*/src"/>
<arg path="./microservices/*/src"/>
<arg path="./packages/*/tests" />
<arg path="./microservices/*/tests"/>
</exec>
<exec executable="${path.eslint.executable}" passthru="true" checkreturn="true">
<arg value="--color" />
<arg value="--fix" />
<arg path="${path.framework}/src/Resources/scripts" />
<arg value="--config" />
<arg path="${path.framework}/.eslintrc.json" />
<arg value="--ignore-path" />
<arg path="${path.framework}/.eslintignore" />
</exec>
</target>
<target name="standards-fix-packages-diff" description="Automatically fixes some coding standards violations in all changed files of packages and microservices.">
<exec executable="${path.ecs.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg value="check" />
<arg value="--fix" />
<arg value="--verbose" />
<arg path="./packages/*/src"/>
<arg path="./microservices/*/src"/>
<arg path="./packages/*/tests" />
<arg path="./microservices/*/tests"/>
</exec>
<exec executable="${path.eslint.executable}" passthru="true" checkreturn="true">
<arg value="--color" />
<arg value="--fix" />
<arg path="${path.framework}/src/Resources/scripts" />
<arg value="--config" />
<arg path="${path.framework}/.eslintrc.json" />
<arg value="--ignore-path" />
<arg path="${path.framework}/.eslintignore" />
</exec>
</target>
<target name="phpstan" depends="tests-acceptance-build" description="Performs static analysis of PHP files using PHPStan on all packages.">
<exec executable="${path.phpstan.executable}" logoutput="true" passthru="true" checkreturn="true">
<arg value="analyze"/>
<arg value="-c"/>
<arg path="./phpstan.neon"/>
<arg path="${path.src}"/>
<arg path="${path.tests}"/>
<arg path="./packages/*/src"/>
<arg path="./packages/*/tests"/>
<arg value="--level=0"/>
</exec>
</target>
<target name="tests" depends="test-db-demo,tests-unit,tests-db,tests-smoke,tests-packages" description="Runs unit, database and smoke tests on a newly built test database and runs tests of all packages."/>
<target name="tests-packages" description="Runs tests of packages.">
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/product-feed-google/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/product-feed-heureka/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/product-feed-heureka-delivery/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/product-feed-zbozi/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/http-smoke-testing/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.packages}/migrations/tests"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="--configuration"/>
<arg value="${path.packages}/framework/phpunit.xml"/>
</exec>
<exec executable="${path.vendor}/bin/phpunit" logoutput="true" passthru="true" checkreturn="true">
<arg value="${path.microservices}/product-search-export/tests"/>
</exec>
</target>
<target name="dump-translations" depends="dump-translations-project-base, dump-translations-packages" description="Extracts translatable messages in all packages ." />
<target name="dump-translations-project-base" description="Extracts translatable messages from all source files in project base.">
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysShopBundle" />
<arg value="--dir=${path.src}/Shopsys/ShopBundle" />
<arg value="--exclude-dir=frontend/plugins" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.src}/Shopsys/ShopBundle/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
</target>
<target name="dump-translations-packages" description="Extracts translatable messages in all packages .">
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysFormTypesBundle" />
<arg value="--dir=${path.packages}/form-types-bundle/src" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.packages}/form-types-bundle/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysFrameworkBundle" />
<arg value="--dir=${path.framework}/src" />
<arg value="--exclude-dir=admin/plugins" />
<arg value="--exclude-dir=Component/Translation" />
<arg value="--exclude-dir=Component/Javascript/Compiler" />
<arg value="--exclude-name=*AnnotatedRouteControllerLoader.php" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.framework}/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysProductFeedGoogleBundle" />
<arg value="--dir=${path.packages}/product-feed-google/src" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.packages}/product-feed-google/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysProductFeedHeurekaBundle" />
<arg value="--dir=${path.packages}/product-feed-heureka/src" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.packages}/product-feed-heureka/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysProductFeedHeurekaDeliveryBundle" />
<arg value="--dir=${path.packages}/product-feed-heureka-delivery/src" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.packages}/product-feed-heureka-delivery/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
<arg value="${path.bin-console}" />
<arg value="translation:extract" />
<arg value="--bundle=ShopsysProductFeedZboziBundle" />
<arg value="--dir=${path.packages}/product-feed-zbozi/src" />
<arg value="--output-format=po" />
<arg value="--output-dir=${path.packages}/product-feed-zbozi/src/Resources/translations" />
<arg value="cs" />
<arg value="en" />
</exec>
</target>
</project>