forked from phergie/phergie
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
304 lines (258 loc) · 12.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
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Phergie" default="core">
<tstamp>
<format property="DSTAMP" pattern="%Y-%m-%d" />
</tstamp>
<taskdef name="phergiepkg" classname="PhergiePackageTask" />
<taskdef name="phpdocumentor" classname="phing.tasks.ext.phpdoc.PhpDocumentorTask" />
<available file="./build.properties" property="have_properties_file" />
<property name="clean" value="true" />
<target name="input">
<if>
<equals arg1="${have_properties_file}" arg2="true" />
<then>
<property file="./build.properties" />
</then>
<else>
<input propertyname="build.srcdir" defaultvalue="./" message="Source directory" />
<input propertyname="build.dstdir" defaultvalue="./" message="Destination directory" />
<input propertyname="build.version.release" message="Release version" />
<input propertyname="build.version.api" message="API version" />
<input propertyname="build.stability.release" defaultvalue="stable" message="Release stability" validArgs="snapshot,devel,alpha,beta,stable" />
<input propertyname="build.stability.api" defaultvalue="stable" message="API stability" validArgs="snapshot,devel,alpha,beta,stable" />
<input propertyname="build.notes" message="Release notes" />
<input propertyname="build.phpdep" defaultvalue="5.2.0" message="PHP version required" />
<input propertyname="build.pearinstallerdep" defaultvalue="1.9.0" message="PEAR installer version required" />
</else>
</if>
<fileset dir="${build.srcdir}" id="core">
<include name="phergie.php" />
<include name="phergie.bat" />
<include name="LICENSE" />
<include name="Settings.php.dist" />
<include name="Phergie/Autoload.php" />
<include name="Phergie/Bot.php" />
<include name="Phergie/Config/Exception.php" />
<include name="Phergie/Config.php" />
<include name="Phergie/Connection/Exception.php" />
<include name="Phergie/Connection/Handler.php" />
<include name="Phergie/Connection.php" />
<include name="Phergie/Driver/Abstract.php" />
<include name="Phergie/Driver/Exception.php" />
<include name="Phergie/Driver/Streams.php" />
<include name="Phergie/Event/Abstract.php" />
<include name="Phergie/Event/Command.php" />
<include name="Phergie/Event/Exception.php" />
<include name="Phergie/Event/Handler.php" />
<include name="Phergie/Event/Request.php" />
<include name="Phergie/Event/Response.php" />
<include name="Phergie/Exception.php" />
<include name="Phergie/Hostmask/Exception.php" />
<include name="Phergie/Hostmask.php" />
<include name="Phergie/Plugin/Abstract.php" />
<include name="Phergie/Plugin/Exception.php" />
<include name="Phergie/Plugin/Handler.php" />
<include name="Phergie/Plugin/Iterator.php" />
<include name="Phergie/Process/Abstract.php" />
<include name="Phergie/Process/Async.php" />
<include name="Phergie/Process/Exception.php" />
<include name="Phergie/Process/Standard.php" />
<include name="Phergie/Ui/Abstract.php" />
<include name="Phergie/Ui/Console.php" />
</fileset>
</target>
<target name="core" depends="input">
<property name="build.tmpdir" value="Phergie-${build.version.release}" />
<property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
<delete file="${build.tarball}" quiet="true" />
<mkdir dir="${build.tmpdir}" />
<copy todir="${build.tmpdir}">
<fileset refid="core" />
</copy>
<reflexive file="${build.tmpdir}/Phergie/Bot.php">
<filterchain>
<replaceregexp>
<regexp
pattern="const VERSION = '[^']+';"
replace="const VERSION = '${build.version.release}';"
/>
</replaceregexp>
</filterchain>
</reflexive>
<phergiepkg name="Phergie" dir="${build.tmpdir}">
<fileset refid="core" />
<option name="baseinstalldir" value="/" />
<option name="outputdirectory" value="${build.dstdir}" />
<option name="channel" value="pear.phergie.org" />
<option name="summary" value="Phergie core library" />
<option name="description" value="The Phergie package provides all files necessary to run a basic IRC bot." />
<option name="apiversion" value="${build.version.api}" />
<option name="apistability" value="${build.stability.api}" />
<option name="releaseversion" value="${build.version.release}" />
<option name="releasestability" value="${build.stability.release}" />
<option name="phpdep" value="${build.phpdep}" />
<option name="pearinstallerdep" value="${build.pearinstallerdep}" />
<option name="license" value="http://phergie.org/license New BSD License" />
<option name="packagetype" value="php" />
<option name="notes" value="${build.notes}" />
<mapping name="replacements">
<element>
<element key="path" value="phergie.php" />
<element key="type" value="pear-config" />
<element key="from" value="/usr/bin/env php" />
<element key="to" value="php_bin" />
</element>
<element>
<element key="path" value="phergie.bat" />
<element key="type" value="pear-config" />
<element key="from" value="@php_bin@" />
<element key="to" value="php_bin" />
</element>
<element>
<element key="path" value="phergie.bat" />
<element key="type" value="pear-config" />
<element key="from" value="@bin_dir@" />
<element key="to" value="bin_dir" />
</element>
</mapping>
<mapping name="exceptions">
<element key="phergie.php" value="script" />
<element key="phergie.bat" value="script" />
</mapping>
<mapping name="releases">
<element>
<element key="installconditions">
<element key="os" value="windows" />
</element>
<element key="filelist">
<element key="install">
<element key="phergie.php" value="phergie" />
</element>
</element>
</element>
<element>
<element key="filelist">
<element key="install">
<element key="phergie.php" value="phergie" />
</element>
<element key="ignore">
<element value="phergie.bat" />
</element>
</element>
</element>
</mapping>
<mapping name="deps">
<element>
<element key="type" value="ext" />
<element key="name" value="pcre" />
</element>
<element>
<element key="type" value="ext" />
<element key="name" value="reflection" />
</element>
</mapping>
</phergiepkg>
<phingcall target="build" />
<phingcall target="clean" />
</target>
<target name="plugin" depends="input">
<if>
<equals arg1="${have_properties_file}" arg2="true" />
<then>
<property file="./build.properties" />
</then>
<else>
<input propertyname="build.plugin" message="Short plugin name" />
<input propertyname="build.summary" message="Plugin summary" />
<input propertyname="build.description" message="Plugin description" />
</else>
</if>
<property name="build.class" value="Phergie_Plugin_${build.plugin}" />
<property name="build.tmpdir" value="${build.class}-${build.version.release}" />
<property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
<fileset dir="${build.srcdir}" id="plugin">
<include name="Phergie/Plugin/${build.plugin}.php" />
<include name="Phergie/Plugin/${build.plugin}/**" />
</fileset>
<delete file="${build.tarball}" quiet="true" />
<mkdir dir="${build.tmpdir}" />
<copy todir="${build.tmpdir}">
<fileset refid="plugin" />
</copy>
<phergiepkg name="${build.class}" dir="${build.tmpdir}">
<fileset refid="plugin" />
<option name="baseinstalldir" value="/" />
<option name="outputdirectory" value="${build.dstdir}" />
<option name="channel" value="pear.phergie.org"/>
<option name="summary" value="${build.summary}"/>
<option name="description" value="${build.description}"/>
<option name="apiversion" value="${build.version.api}"/>
<option name="apistability" value="${build.stability.api}"/>
<option name="releaseversion" value="${build.version.release}"/>
<option name="releasestability" value="${build.stability.release}"/>
<option name="phpdep" value="${build.phpdep}" />
<option name="pearinstallerdep" value="${build.pearinstallerdep}" />
<option name="license" value="http://phergie.org/license New BSD License"/>
<option name="packagetype" value="php"/>
<option name="notes" value="${build.notes}"/>
<role extension="db" role="data"/>
</phergiepkg>
<phingcall target="build" />
<phingcall target="clean" />
</target>
<target name="docs" depends="input">
<property name="build.tmpdir" value="Phergie_Docs-${build.version.release}" />
<property name="build.tarball" value="${build.dstdir}${build.tmpdir}.tgz" />
<delete file="${build.tarball}" quiet="true" />
<mkdir dir="${build.tmpdir}" />
<phpdocumentor title="API Documentation"
destdir="${build.tmpdir}/api"
output="HTML:Smarty:PHP">
<fileset refid="core" />
<projdocfileset dir=".">
<include name="LICENSE" />
</projdocfileset>
</phpdocumentor>
<phergiepkg name="Phergie_Docs" dir="${build.tmpdir}">
<fileset dir="${build.tmpdir}">
<include name="api**" />
</fileset>
<option name="baseinstalldir" value="/" />
<option name="outputdirectory" value="${build.dstdir}" />
<option name="channel" value="pear.phergie.org" />
<option name="summary" value="Phergie core library documentation" />
<option name="description" value="The Phergie_Docs package provides documentation for the Phergie core libraries." />
<option name="apiversion" value="${build.version.api}" />
<option name="apistability" value="${build.stability.api}" />
<option name="releaseversion" value="${build.version.release}" />
<option name="releasestability" value="${build.stability.release}" />
<option name="phpdep" value="${build.phpdep}" />
<option name="pearinstallerdep" value="${build.pearinstallerdep}" />
<option name="license" value="http://phergie.org/license New BSD License" />
<option name="packagetype" value="php" />
<option name="notes" value="${build.notes}" />
<mapping name="exceptions">
<element key="api" value="doc" />
</mapping>
</phergiepkg>
<phingcall target="build" />
<phingcall target="clean" />
</target>
<target name="build">
<tar destfile="${build.tarball}" compression="gzip">
<fileset dir="${build.dstdir}">
<include name="${build.tmpdir}**" />
<include name="package.xml" />
</fileset>
</tar>
</target>
<target name="clean">
<if>
<istrue value="${clean}" />
<then>
<delete dir="${build.tmpdir}" />
<delete file="${build.dstdir}package.xml" />
</then>
</if>
</target>
</project>