-
Notifications
You must be signed in to change notification settings - Fork 0
/
joomla-packager.xml
539 lines (461 loc) · 24 KB
/
joomla-packager.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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
<?xml version="1.0"?>
<project name="joomla-packager" default="clean" basedir=".">
<tstamp>
<format property="DATE" pattern="%Y-%m-%d"/>
</tstamp>
<!-- TODO move to properties-->
<!-- TODO move to properties-->
<!--<property file="build/config/build.properties" />-->
<property name="repository.dir" value="C:\Users\cedric\Dropbox\galaxiis.com\httpdocs\repository"/>
<property name="jed.dir" value="C:\Users\cedric\Dropbox\galaxiis.com\httpdocs\jed"/>
<property name="showcase.dir" value="C:\Users\cedric\Dropbox\galaxiis.com\subdomains\showcase"/>
<property name="joomla.dir" value="C:\Users\cedric\Dropbox\phpstart\www\dev"/>
<!-- http://www.zachleat.com/web/using-phing-to-automate-javascript-and-css-minimization/ -->
<taskdef classname="yuicompressor.yuicompressorTask" name="yuicompressor"/>
<target name="update.Jed" description="updateJedUpdate"
depends="updateJedUpdate">
</target>
<target name="package.all" description="build all package"
depends="clean,package.premium,package.free">
</target>
<target name="package.premium" description="build the package">
<phingcall target="build">
<property name="packageType" value=""/>
<property name="isJoomla30" value="1"/>
<property name="isJoomla25" value="0"/>
<property name="joomlaID" value="j33_j34"/>
<property name="isPremium" value="1"/>
<property name="isFree" value="0"/>
<property name="disabled" value="false"/>
<property name="phase" value="package"/>
</phingcall>
</target>
<target name="package.free" description="build the package">
<phingcall target="build">
<property name="packageType" value="-free"/>
<property name="isJoomla30" value="1"/>
<property name="isJoomla25" value="0"/>
<property name="joomlaID" value="j33_j34"/>
<property name="isPremium" value="0"/>
<property name="isFree" value="1"/>
<property name="disabled" value="true"/>
<property name="phase" value="package"/>
</phingcall>
</target>
<target name="deploy.all" depends="clean,deploy.premium,deploy.free">
</target>
<target name="deploy.premium" depends="clean">
<phingcall target="build">
<property name="packageType" value=""/>
<property name="isJoomla30" value="1"/>
<property name="isJoomla25" value="0"/>
<property name="joomlaID" value="j33_j34"/>
<property name="isPremium" value="1"/>
<property name="isFree" value="0"/>
<property name="disabled" value="false"/>
<property name="phase" value="deploy"/>
</phingcall>
</target>
<target name="deploy.free" depends="clean">
<phingcall target="build">
<property name="packageType" value="-free"/>
<property name="isJoomla30" value="1"/>
<property name="isJoomla25" value="0"/>
<property name="joomlaID" value="j34_j34"/>
<property name="isPremium" value="0"/>
<property name="isFree" value="1"/>
<property name="disabled" value="true"/>
<property name="phase" value="deploy"/>
</phingcall>
</target>
<target name="build" depends="clean" hidden="true">
<property name="filename" value="pkg_${itsShortID}_${joomlaID}_${itsVersion}${packageType}.zip"/>
<property name="delivery.dir" value="${temp}\${itsShortID}_${itsVersion}${packageType}"/>
<property name="packages.dir" value="${temp}\pkg_${itsShortID}_${joomlaID}_${itsVersion}${packageType}"/>
<property name="delivery.file" value="${delivery.dir}/../${filename}"/>
<mkdir dir="${packages.dir}"/>
<echo message="Running build.xml. Assembling"/>
<phingcall target="doComponents"/>
<phingcall target="doPlugins"/>
<phingcall target="doModules"/>
<phingcall target="doLibraries"/>
<phingcall target="doCreateManifest"/>
<phingcall target="doCreateRelease"/>
<if>
<equals arg1="${phase}" arg2="deploy" />
<then>
<phingcall target="doMoveToRepository"/>
<phingcall target="createChangelog"/>
<phingcall target="updateJedUpdate"/>
<phingcall target="updateGithub"/>
</then>
</if>
</target>
<target name="yuicompressor" description="build the package" depends="clean" hidden="true">
<yuicompressor inputfiles="${build.srcdir}/js/_files.php" outputcombined="${build.deploydir}/js/all.js" outputmin="${build.deploydir}/js/all-min.js"/>
</target>
<target name="doMoveToShowcase" hidden="true">
<echo message="Copy all files to showcase in ${showcase.dir}"/>
<phingcall target="copyIfDirExist">
<property name="from" value="administrator/components/com_${itsShortID}"/>
<property name="to" value="${showcase.dir}/administrator/components/com_${itsShortID}"/>
</phingcall>
<phingcall target="copyIfDirExist">
<property name="from" value="components/com_${itsShortID}"/>
<property name="to" value="${showcase.dir}/components/com_${itsShortID}"/>
</phingcall>
</target>
<target name="doComponents" hidden="true">
<foreach list="${itsComponents}" param="componentShortID" target="doComponent"/>
</target>
<target name="doPlugins" hidden="true">
<foreach list="${itsContentPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="content"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsCedXMapPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="cedxmap"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsInstallerPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="installer"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsAuthenticationPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="authentication"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsCaptchaPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="captcha"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsEditorsPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="editors"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsEditorsXtdPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="editors-xtd"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsExtensionPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="extension"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsFinderPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="finder"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsQuickiconPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="quickicon"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsSearchPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="search"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsSystemPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="system"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsUserPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="user"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
<foreach list="${itsXmlrpcPlugins}" param="pluginID" target="doPlugin">
<property name="type" value="xmlrpc"/>
<property name="package.buildType" value="${package.buildType}"/>
</foreach>
</target>
<target name="doModules" hidden="true">
<foreach list="${itsModules}" param="moduleID" target="doModule"/>
</target>
<target name="doLibraries" hidden="true">
<foreach list="${itsLibraries}" param="libraryID" target="doLibrary"/>
</target>
<target name="clean">
<echo message="Running Cleaning"/>
<phingcall target="deleteDirIfExist">
<param name="dir" value="${delivery.dir}"/>
</phingcall>
<delete file="${delivery.file}"/>
</target>
<target name="doCreateRelease" hidden="true">
<echo message="creating ${delivery.file}"/>
<zip destfile="${delivery.file}">
<fileset dir="${packages.dir}">
<include name="*.zip"/>
<include name="pkg_*.xml"/>
</fileset>
</zip>
<!--<delete dir="${packages.dir}"/>-->
<!--<delete dir="${delivery.dir}"/>-->
</target>
<target name="doMoveToRepository" hidden="true">
<echo message="moving ${delivery.file}"/>
<!--https://www.akeebabackup.com/support/akeeba-release-system/16120-using-bleeding-edge-feature-for-stable-releases.html-->
<!--Bleeding Edge releases and items are automatically published/unpublished depending on whether the
directory (release) or file (item) exists. The problem here is that the path is passed through JPath for
verification. If your path contains dots, and other similar characters which JPath considers suspicious
and automatically strips from the path, the effective path seen by ARS is non-existent and the items get
removed. In this case, just substitute dots with dashes or underscores. For example, a release directory
1.0.0 gets translated to 100 and ARS thinks it doesn't exist. If you use 1_0_0 or 1-0-0 you will have no
problem. As far as I know, there is no such constraint for filenames, but it's safer to use only alphanumeric
characters, dots, dashes and underscores in the filenames.-->
<property name="copyReleaseToDirectory" value="${repository.dir}/${itsShortID}${packageType}/${itsVersion}_STABLE"/>
<mkdir dir="${copyReleaseToDirectory}"/>
<phingcall target="copyIfFileExist">
<property name="file" value="${delivery.file}"/>
<property name="to" value="${copyReleaseToDirectory}"/>
</phingcall>
<echo message="DELETING ${temp}\${filename}"/>
<delete file="${temp}\${filename}"/>
</target>
<target name="updateGithub" hidden="false">
<echo message="copy ${delivery.dir}"/>
<phingcall target="copyIfDirExist">
<property name="from" value="${delivery.dir}"/>
<property name="to" value="${githubFolder}"/>
</phingcall>
<gitcommit repository="${githubFolder}" message="added release ${itsVersion}" allFiles="true" />
<gitpush repository="${githubFolder}"/>
</target>
<target name="createChangelog" hidden="true">
<touch file="${repository.dir}/${itsShortID}/${itsVersion}_STABLE/CHANGELOG"/>
</target>
<target name="createChangelogFree" hidden="true">
<touch file="${repository.dir}/${itsShortID}-free/${itsVersion}_STABLE/CHANGELOG"/>
</target>
<target name="doCreateManifest" hidden="true">
<echo message="creating pkg_${itsShortID}.xml"/>
<!--
<echo file="${packages.dir}/pkg_${itsShortID}.xml" append="true">
ideally generate this file with a template
</echo>
<copy file="pkg_${itsShortID}.xml" todir="${packages.dir}/" overwrite="true"/> -->
<copy file="${manifestLocation}" tofile="${packages.dir}/pkg_${itsShortID}${packageType}.xml" overwrite="true">
<filterchain refid="filterchain"/>
</copy>
</target>
<target name="doLibrary" hidden="true">
<echo message="preparing ## ${libraryID}"/>
<!-- copy code -->
<copy todir="${delivery.dir}/libraries/${libraryID}" overwrite="true">
<fileset dir="${joomla.dir}/libraries/${libraryID}" includes="**/*"></fileset>
<filterchain refid="filterchain"/>
</copy>
<!-- Optional Languages -->
<phingcall target="copyComponentLanguages">
<property name="file" value="lib_${libraryID}.ini"/>
<property name="to" value="${delivery.dir}/libraries/${libraryID}/language/"/>
</phingcall>
<phingcall target="copyComponentLanguages">
<property name="file" value="lib_${libraryID}.sys.ini"/>
<property name="to" value="${delivery.dir}/libraries/${libraryID}/language/"/>
</phingcall>
<!-- Optional Media -->
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/media/${libraryID}"/>
<property name="to" value="${delivery.dir}/libraries/${libraryID}"/>
</phingcall>
<echo message="packaging ${libraryID}"/>
<zip destfile="${packages.dir}/lib_${libraryID}.zip" basedir="${delivery.dir}/libraries/${libraryID}"/>
</target>
<target name="doComponent" hidden="true">
<property name="componentID" value="com_${componentShortID}"/>
<property name="delivery.base" value="${delivery.dir}/${componentID}/"/>
<property name="delivery.admin" value="${delivery.base}/administrator/components/${componentID}"/>
<property name="delivery.site" value="${delivery.base}/components/${componentID}"/>
<property name="base.admin" value="${joomla.dir}/administrator/components/${componentID}"/>
<property name="base.site" value="${joomla.dir}/components/${componentID}"/>
<echo message="preparing ${componentID}"/>
<!-- Optional Languages -->
<phingcall target="copyAdminLanguages">
<property name="file" value="${componentID}.ini"/>
<property name="to" value="${delivery.base}/administrator/language/"/>
</phingcall>
<phingcall target="copyAdminLanguages">
<property name="file" value="${componentID}.sys.ini"/>
<property name="to" value="${delivery.base}/administrator/language/"/>
</phingcall>
<phingcall target="copyComponentLanguages">
<property name="file" value="${componentID}.ini"/>
<property name="to" value="${delivery.base}/language/"/>
</phingcall>
<!-- Optional Media -->
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/media/${componentID}"/>
<property name="to" value="${delivery.base}/media/${componentID}"/>
</phingcall>
<!-- Optional /images/ -->
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/images/${componentID}"/>
<property name="to" value="${delivery.base}/images/${componentID}"/>
</phingcall>
<!-- Frontend -->
<copy todir="${delivery.site}" overwrite="true">
<fileset dir="${base.site}" includes="**/*.*"></fileset>
<filterchain refid="filterchain"/>
</copy>
<!-- Backend -->
<copy todir="${delivery.admin}" overwrite="true">
<fileset dir="${base.admin}" includes="**/*.*"></fileset>
<filterchain refid="filterchain"/>
</copy>
<move file="${delivery.admin}/${componentShortID}.xml" tofile="${delivery.base}/${componentShortID}.xml" overwrite="true"/>
<echo message="packaging ${componentID}"/>
<zip destfile="${packages.dir}/${componentID}.zip" basedir="${delivery.dir}/${componentID}">
<fileset dir="${delivery.dir}/${componentID}" includes="**/*"/>
</zip>
</target>
<target name="doPlugin" hidden="true">
<echo message="preparing plugin ${pluginID} of type ${type}"/>
<!-- step 1-->
<copy todir="${delivery.dir}/plugins/${type}/${pluginID}" overwrite="true">
<fileset dir="${joomla.dir}/plugins/${type}/${pluginID}" includes="**/*.*"></fileset>
<filterchain refid="filterchain"/>
</copy>
<!-- Optional Media -->
<if>
<equals arg1="${package.buildType}" arg2="showcase" />
<then>
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/media/plg_${type}_${pluginID}"/>
<property name="to" value="${delivery.dir}/media/plg_${type}_${pluginID}"/>
</phingcall>
</then>
<else>
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/media/plg_${type}_${pluginID}"/>
<property name="to" value="${delivery.dir}/plugins/${type}/${pluginID}/plg_${type}_${pluginID}"/>
</phingcall>
</else>
</if>
<!-- zipping result -->
<echo message="packaging plugin ${pluginID} of type ${type}"/>
<zip destfile="${packages.dir}/plg_${type}_${pluginID}.zip" basedir="${delivery.dir}/plugins/${type}/${pluginID}">
<fileset dir="${delivery.dir}/plugins/${type}/${pluginID}" includes="**/*"/>
</zip>
</target>
<target name="doModule" hidden="true">
<echo message="preparing ${moduleID}"/>
<copy todir="${delivery.dir}/modules/${moduleID}" overwrite="true">
<fileset dir="${joomla.dir}/modules/${moduleID}" includes="**/*.*"></fileset>
<filterchain refid="filterchain"/>
</copy>
<!-- Optional Languages -->
<phingcall target="copyModuleLanguages">
<property name="file" value="${moduleID}.ini"/>
<property name="to" value="${delivery.dir}/modules/${moduleID}"/>
</phingcall>
<phingcall target="copyModuleLanguages">
<property name="file" value="${moduleID}.sys.ini"/>
<property name="to" value="${delivery.dir}/modules/${moduleID}"/>
</phingcall>
<!-- Optional Media -->
<phingcall target="copyIfDirExist">
<property name="from" value="${joomla.dir}/media/${moduleID}"/>
<property name="to" value="${delivery.dir}/modules/${moduleID}/${moduleID}"/>
</phingcall>
<echo message="packaging ${moduleID}"/>
<zip destfile="${packages.dir}/${moduleID}.zip" basedir="${delivery.dir}/modules/${moduleID}">
<fileset dir="${delivery.dir}/modules/${moduleID}" includes="**/*"/>
</zip>
</target>
<!-- TODO use the same pattern directory for both, check what joomla recommend -->
<target name="copyComponentLanguages" hidden="true">
<foreach list="${itsLanguages}" param="language" target="copyIfFileExist">
<property name="file" value="${joomla.dir}/language/${language}/${language}.${file}"/>
<property name="to" value="${to}/${language}"/>
</foreach>
</target>
<target name="copyModuleLanguages" hidden="true">
<foreach list="${itsLanguages}" param="language" target="copyIfFileExist">
<property name="file" value="${joomla.dir}/language/${language}/${language}.${file}"/>
<property name="to" value="${to}"/>
</foreach>
</target>
<target name="copyAdminLanguages" hidden="true">
<foreach list="${itsLanguages}" param="language" target="copyIfFileExist">
<property name="file" value="${joomla.dir}/administrator/language/${language}/${language}.${file}"/>
<property name="to" value="${delivery.base}/administrator/language/${language}"/>
</foreach>
</target>
<target name="copyLanguage" hidden="true">
<foreach list="${itsLanguages}" param="language" target="copyIfFileExist">
<property name="file" value="${joomla.dir}/language/${language}/${language}.${file}"/>
<property name="to" value="${delivery.base}/language/${language}"/>
</foreach>
</target>
<target name="copyIfDirExist" hidden="true">
<if>
<available file='${from}' type='dir'/>
<then>
<copy todir="${to}" overwrite="true">
<!--TODO here build filter that prefer *.min.js and *.min.css over -js and -css
or better run yuicompressor -->
<fileset dir="${from}" includes="**/*.*"></fileset>
<filterchain refid="filterchain"/>
</copy>
</then>
</if>
</target>
<target name="deleteDirIfExist" hidden="true">
<if>
<available file='${dir}' type='dir'/>
<then>
<delete dir="${dir}" includeemptydirs="true" verbose="true" failonerror="true"/>
</then>
</if>
</target>
<target name="copyIfFileExist" hidden="true">
<echo message="Copy if file exist ${file} to ${to}"/>
<if>
<available file='${file}' type='file'/>
<then>
<copy file="${file}" todir="${to}" overwrite="true">
<filterchain refid="filterchain"/>
</copy>
</then>
</if>
</target>
<target name="updateJedUpdate" hidden="true">
<echo message="copying ${jedUpdateFile}"/>
<mkdir dir="${jed.dir}"/>
<phingcall target="copyIfFileExist">
<property name="file" value="${jedUpdateFile}"/>
<property name="to" value="${jed.dir}"/>
</phingcall>
</target>
<filterchain id="filterchain">
<filterreader classname="preprocessor.PreProcessorFilter">
<param name="premium" value="${isPremium}"/>
<param name="free" value="${isFree}"/>
<param name="joomla25" value="${isJoomla25}"/>
<param name="joomla30" value="${isJoomla30}"/>
<param name="macrodir" value="preprocessor/macros"/>
</filterreader>
<replacetokens begintoken="%%" endtoken="%%">
<token key="shortId" value="${itsShortID}"/>
<token key="version" value="${itsVersion}"/>
<token key="licensedTo" value="${licensedTo}"/>
<token key="licenseId" value="${licenseId}"/>
<token key="copyright" value="${copyright}"/>
<token key="package" value="${package}"/>
<token key="subpackage" value="${subpackage}"/>
<token key="packageType" value="${packageType}"/>
<token key="date" value="${DATE}"/>
<token key="disableForFreeVersion" value="${isFree}"/>
<token key="creationDate" value="${DATE}"/>
<token key="disabled" value="${disabled}"/>
</replacetokens>
</filterchain>
<fileset dir="${delivery.dir}" id="phpfiles">
<include name="*.php"/>
<include name="**/*.php"/>
</fileset>
<target name="checkSyntaxErrors" hidden="true">
<phplint>
<fileset refid="phpfiles"/>
</phplint>
</target>
</project>