This repository has been archived by the owner on Mar 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.xml
239 lines (217 loc) · 11.6 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="podcast-manager" default="dev_head" basedir=".">
<!-- Project properties -->
<property name="repo.dir" value="." />
<property name="version" value="2.2.0" />
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd" />
</tstamp>
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<exec executable="git" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<!-- Build a package for testing -->
<target name="dev_head" description="Builds test packages based on the development head" depends="rebuild-packages,copy-files,zip-packages">
<echo message="Deleting old master builds" />
<delete includeemptydirs="true">
<fileset dir=".">
<include name="files_podcastmanager_hathor_${version}.zip" />
<include name="pkg_podcastmanager_${version}.zip" />
</fileset>
</delete>
<echo message="Build Podcast Manager package" />
<zip destfile="pkg_podcastmanager_${version}.zip">
<fileset dir="packaging">
<include name="language/**" />
<include name="packages/**" />
<include name="pkg_podcastmanager.xml" />
<include name="script.php" />
<include name="strapped/**" />
</fileset>
</zip>
<echo message="Building Hathor Overrides package" />
<zip destfile="files_podcastmanager_hathor_${version}.zip" basedir="packaging/files_podcastmanager_hathor" />
<echo message="Building Isis Overrides package" />
<zip destfile="files_podcastmanager_strapped_${version}.zip" basedir="packaging/strapped" />
</target>
<!-- Build a package for release -->
<target name="release" description="Builds release packages based on the development head" depends="rebuild-packages,copy-files,zip-packages">
<echo message="Build Podcast Manager package" />
<mkdir dir="releases" />
<zip destfile="releases/pkg_podcastmanager_${version}.zip">
<fileset dir="packaging">
<include name="language/**" />
<include name="packages/**" />
<include name="pkg_podcastmanager.xml" />
<include name="script.php" />
<include name="strapped/**" />
</fileset>
</zip>
<echo message="Building Hathor Overrides package" />
<zip destfile="releases/files_podcastmanager_hathor_${version}.zip" basedir="packaging/files_podcastmanager_hathor" />
<echo message="Building Isis Overrides package" />
<zip destfile="releases/files_podcastmanager_strapped_${version}.zip" basedir="packaging/strapped" />
<echo message="Committing version" />
<git command="commit">
<args>
<arg value="-am 'Prepare ${version} release'" />
</args>
</git>
<echo message="Creating Git tag" />
<git command="tag">
<args>
<arg value="${version}" />
</args>
</git>
<echo message="Pushing Version commit and tag to GitHub" />
<git command="push">
</git>
<git command="push">
<args>
<arg value="--tags" />
</args>
</git>
</target>
<!-- Copy files to staging to allow for manipulation pre-package -->
<target name="copy-files" description="Stages the common files" depends="rebuild-packages">
<echo message="Staging files for packaging" />
<echo message="Create com_podcastmanager package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/com_podcastmanager">
<fileset dir="com_podcastmanager" />
</copy>
<replace file="packaging/staging/com_podcastmanager/podcastmanager.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/com_podcastmanager/podcastmanager.xml" token="##VERSION##" value="${version}" />
<echo message="Create com_podcastmedia package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/com_podcastmedia">
<fileset dir="com_podcastmedia" />
</copy>
<replace file="packaging/staging/com_podcastmedia/podcastmedia.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/com_podcastmedia/podcastmedia.xml" token="##VERSION##" value="${version}" />
<echo message="Create lib_getid3 package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/lib_getid3">
<fileset dir="lib_getid3" />
</copy>
<echo message="Create mod_podcastmanager package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/mod_podcastmanager">
<fileset dir="mod_podcastmanager" />
</copy>
<replace file="packaging/staging/mod_podcastmanager/mod_podcastmanager.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/mod_podcastmanager/mod_podcastmanager.xml" token="##VERSION##" value="${version}" />
<echo message="Create mod_podcastmanagerfeed package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/mod_podcastmanagerfeed">
<fileset dir="mod_podcastmanagerfeed" />
</copy>
<replace file="packaging/staging/mod_podcastmanagerfeed/mod_podcastmanagerfeed.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/mod_podcastmanagerfeed/mod_podcastmanagerfeed.xml" token="##VERSION##" value="${version}" />
<echo message="Create plg_content_podcastmanager package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/plg_content_podcastmanager">
<fileset dir="plg_content_podcastmanager" />
</copy>
<replace file="packaging/staging/plg_content_podcastmanager/podcastmanager.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/plg_content_podcastmanager/podcastmanager.xml" token="##VERSION##" value="${version}" />
<echo message="Create plg_editors-xtd_podcastmanager package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/plg_editors-xtd_podcastmanager">
<fileset dir="plg_editors-xtd_podcastmanager" />
</copy>
<replace file="packaging/staging/plg_editors-xtd_podcastmanager/podcastmanager.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/plg_editors-xtd_podcastmanager/podcastmanager.xml" token="##VERSION##" value="${version}" />
<echo message="Create plg_finder_podcastmanager_feeds package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/plg_finder_podcastmanager_feeds">
<fileset dir="plg_finder_podcastmanager_feeds" />
</copy>
<replace file="packaging/staging/plg_finder_podcastmanager_feeds/podcastmanager_feeds.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/plg_finder_podcastmanager_feeds/podcastmanager_feeds.xml" token="##VERSION##" value="${version}" />
<echo message="Create plg_finder_podcastmanager_podcasts package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/plg_finder_podcastmanager_podcasts">
<fileset dir="plg_finder_podcastmanager_podcasts" />
</copy>
<replace file="packaging/staging/plg_finder_podcastmanager_podcasts/podcastmanager_podcasts.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/plg_finder_podcastmanager_podcasts/podcastmanager_podcasts.xml" token="##VERSION##" value="${version}" />
<echo message="Create plg_podcastmedia_user package" />
<mkdir dir="packaging/staging" />
<copy todir="packaging/staging/plg_podcastmedia_user">
<fileset dir="plg_podcastmedia_user" />
</copy>
<replace file="packaging/staging/plg_podcastmedia_user/user.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/staging/plg_podcastmedia_user/user.xml" token="##VERSION##" value="${version}" />
<echo message="Copy package manifest" />
<copy file="pkg_podcastmanager.xml" tofile="packaging/pkg_podcastmanager.xml" overwrite="true" />
<replace file="packaging/pkg_podcastmanager.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/pkg_podcastmanager.xml" token="##VERSION##" value="${version}" />
<echo message="Copy package scriptfile" />
<copy file="script.php" tofile="packaging/script.php" overwrite="true" />
<echo message="Copy package language" />
<copy todir="packaging/language">
<fileset dir="language" />
</copy>
<echo message="Copy Strapped layout files" />
<copy todir="packaging/strapped">
<fileset dir="files_podcastmanager_strapped" />
</copy>
<replace file="packaging/strapped/podcastmanager_strapped.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/strapped/podcastmanager_strapped.xml" token="##VERSION##" value="${version}" />
<echo message="Create files_podcastmanager_hathor package" />
<copy todir="packaging/files_podcastmanager_hathor">
<fileset dir="files_podcastmanager_hathor" />
</copy>
<replace file="packaging/files_podcastmanager_hathor/podcastmanager_hathor.xml" token="##DATE##" value="${build.date}" />
<replace file="packaging/files_podcastmanager_hathor/podcastmanager_hathor.xml" token="##VERSION##" value="${version}" />
</target>
<!-- ZIP the separate extension packages -->
<target name="zip-packages" description="Creates ZIP archives for installation" depends="rebuild-packages,copy-files">
<echo message="Archiving packages" />
<mkdir dir="packaging/packages" />
<zip destfile="packaging/packages/com_podcastmanager.zip" basedir="packaging/staging/com_podcastmanager" />
<zip destfile="packaging/packages/com_podcastmedia.zip" basedir="packaging/staging/com_podcastmedia" />
<zip destfile="packaging/packages/lib_getid3.zip" basedir="packaging/staging/lib_getid3" />
<zip destfile="packaging/packages/mod_podcastmanager.zip" basedir="packaging/staging/mod_podcastmanager" />
<zip destfile="packaging/packages/mod_podcastmanagerfeed.zip" basedir="packaging/staging/mod_podcastmanagerfeed" />
<zip destfile="packaging/packages/plg_content_podcastmanager.zip" basedir="packaging/staging/plg_content_podcastmanager" />
<zip destfile="packaging/packages/plg_editors-xtd_podcastmanager.zip" basedir="packaging/staging/plg_editors-xtd_podcastmanager" />
<zip destfile="packaging/packages/plg_finder_podcastmanager_feeds.zip" basedir="packaging/staging/plg_finder_podcastmanager_feeds" />
<zip destfile="packaging/packages/plg_finder_podcastmanager_podcasts.zip" basedir="packaging/staging/plg_finder_podcastmanager_podcasts" />
<zip destfile="packaging/packages/plg_podcastmedia_user.zip" basedir="packaging/staging/plg_podcastmedia_user" />
</target>
<!-- Rebuild the staging area -->
<target name="rebuild-packages" description="Delete old packages">
<echo message="Deleting packaging directory" />
<delete dir="${repo.dir}/packaging" includeemptydirs="true" failonerror="true" />
<echo message="Creating packaging directory" />
<mkdir dir="packaging" />
</target>
<!-- Check code style based on Joomla Coding Standard -->
<target name="phpcs" description="Generate codestyle report using PHP_CodeSniffer">
<echo message="Remove previous codestyle report" />
<delete quiet="yes" includeemptydirs="true">
<fileset dir=".">
<include name="build/logs/checkstyle.xml" />
</fileset>
</delete>
<echo message="Running phpcs with Joomla! Coding Standard" />
<exec executable="phpcs">
<arg value="--report=checkstyle" />
<arg value="--extensions=php" />
<arg value="-p" />
<arg value="--report-file=${repo.dir}/build/logs/checkstyle.xml" />
<arg value="--standard=${repo.dir}/build/phpcs/Joomla" />
<arg value="--ignore=${repo.dir}/com_podcastmanager/admin/liveupdate,${repo.dir}/com_podcastmanager/admin/media/js,${repo.dir}/com_podcastmanager/site/media,${repo.dir}/lib_getid3,${repo.dir}/plg_content_podcastmanager/mediaelements,${repo.dir}/packaging,${repo.dir}/releases,*/tmpl/*,${repo.dir}/files_podcastmanager_*,${repo.dir}/build/*" />
<arg path="${repo.dir}" />
</exec>
</target>
</project>