forked from dokuwiki/dokuwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
216 lines (183 loc) · 6.73 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
<?xml version="1.0" encoding="utf-8"?>
<project name="GeSHi" default="pack" basedir=".">
<!--
GeSHi - Generic Syntax Highlighter - phing build file.
Works for 1.0.x
Packs up a new version of geshi, tags it in git and releases it on
sourceforge.net
-->
<property file="build.properties" />
<property name="version" value="1.0.9.0" />
<property name="stability" value="stable" />
<property name="zipfile" value="${phing.project.name}-${version}.zip" />
<property name="gzfile" value="${phing.project.name}-${version}.tar.gz" />
<property name="bz2file" value="${phing.project.name}-${version}.tar.bz2" />
<property name="pkgfile" value="geshi-${version}.tgz" />
<property name="fileprefix" value="geshi/" />
<property name="sfproject" value="GeSHi" />
<property name="sffilepath" value="g/ge/geshi/" />
<property name="releasenotes" value="
Version 1.0.9.0
" />
<fileset dir="src" id="files">
<include name="**"/>
<exclude name="**/.gitignore/"/>
</fileset>
<fileset dir="." id="extra">
<include name="contrib/**"/>
<include name="docs/**"/>
</fileset>
<taskdef name="d51pearpkg2" classname="phing.tasks.ext.d51PearPkg2Task" />
<target name="pack" depends=""
description="Create zip and tar files for release"
>
<mkdir dir="dist" />
<echo msg="Creating distribution files for ${phing.project.name} ${version}"/>
<delete file="dist/${zipfile}" failonerror="false"/>
<delete file="dist/${gzfile}" failonerror="false"/>
<delete file="dist/${bz2file}" failonerror="false"/>
<zip destfile="dist/${zipfile}" prefix="${fileprefix}">
<fileset refid="files" />
<fileset refid="extra" />
</zip>
<tar destfile="dist/${gzfile}" prefix="${fileprefix}" compression="gzip">
<fileset refid="files" />
<fileset refid="extra" />
</tar>
<tar destfile="dist/${bz2file}" prefix="${fileprefix}" compression="bzip2">
<fileset refid="files" />
<fileset refid="extra" />
</tar>
</target>
<target name="pack-pear" depends=""
description="Creates the PEAR package"
>
<mkdir dir="dist/pear" />
<delete file="src/package.xml" failonerror="false" />
<d51pearpkg2 dir="src" baseinstalldir="/">
<name>geshi</name>
<summary>Generic syntax highlighter, written in PHP.</summary>
<description>
GeSHi is a generic syntax highlighter, written in PHP. You simply
input the source code you wish to highlight with the language you
wish to use, and the output will be a file syntax highlighted to
XHTML standards.
</description>
<channel>pear.geshi.org</channel>
<license>AGPL</license>
<version release="${version}" api="${version}" />
<stability release="${stability}" api="${stability}" />
<notes>${releasenotes}</notes>
<dependencies>
<php minimum_version="5.3.0" />
<pear minimum_version="1.9.0" />
</dependencies>
<!-- map directory (key) to role -->
<dirroles key="src">.</dirroles>
<ignore>**/.gitignore</ignore>
<ignore>contrib/**</ignore>
<ignore>dist/**</ignore>
<ignore>docs/**</ignore>
<ignore>*.properties</ignore>
<ignore>*.tgz</ignore>
</d51pearpkg2>
<!-- time to fix the package.xml file since the task does not
allow everything we need:
- strip the base directory names like src, data and www
- remove that dumb baseinstalldir from files
- md5sums are generated automatically when packaging
-->
<!-- yes, we need to generate a 2nd file and move it back -->
<copy file="src/package.xml" tofile="src/package2.xml" overwrite="true">
<filterchain>
<replaceregexp>
<!-- remove md5sums -->
<regexp
pattern="md5sum="[a-z0-9]{32}" "
replace=""
/>
<!-- remove baseinstalldir for files -->
<regexp
pattern="<file baseinstalldir="/""
replace="<file"
/>
<!-- install-as for different directories -->
<regexp
pattern="(<file name="data/(.+?)")"
replace="\1 install-as="\2""
/>
<regexp
pattern="(<file name="doc/(.+?)")"
replace="\1 install-as="\2""
/>
<regexp
pattern="(<file name="tests/(.+?)")"
replace="\1 install-as="\2""
/>
<regexp
pattern="(<file name="www/(.+?)")"
replace="\1 install-as="phorkie/\2""
/>
<regexp
pattern="(<file name="src/(.+?)")"
replace="\1 install-as="\2""
/>
</replaceregexp>
</filterchain>
</copy>
<move file="src/package2.xml" tofile="src/package.xml" overwrite="true" />
<!-- package up -->
<exec command="pear package" passthru="true" dir="src" />
<move file="src/${pkgfile}" todir="${phing.dir}/dist/pear/" />
<delete file="src/package.xml" failonerror="true" />
</target>
<target name="release" depends="check,pack,pack-pear,deploy-sf,gittag"
description="Release the version on sourceforge"
>
<!-- meta-target -->
</target>
<!--
https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download
-->
<target name="deploy-sf" depends="check,pack"
description="Upload release to sourceforge"
>
<delete dir="dist/deploy-sf" /><!-- make empty -->
<mkdir dir="dist/deploy-sf" />
<mkdir dir="dist/deploy-sf/geshi" />
<mkdir dir="dist/deploy-sf/geshi/GeSHi ${version}" />
<copy todir="dist/deploy-sf/geshi/GeSHi ${version}/">
<fileset dir="dist">
<include name="${zipfile}" />
<include name="${gzfile}" />
<include name="${bz2file}" />
</fileset>
</copy>
<!-- test
<exec command="rsync -av dist/deploy-sf/ /tmp/test/" escape="false" />
-->
<exec
command="rsync -av -e ssh dist/deploy-sf/ ${sfuser},${sfproject}@frs.sourceforge.net:/home/frs/project/${sffilepath}/${sfproject}/"
escape="false" checkreturn="false"
/>
<!-- rsync always returns code 23 on sourceforge releases, so we
can't check return values -->
</target>
<target name="gittag"
description="create the git tag for the current version"
>
<exec
command="git tag v${version}'"
escape="false" checkreturn="true"
/>
</target>
<target name="check"
description="Check variables"
>
<fail unless="version" message="Version not defined!" />
<fail unless="sfuser" message="Sourceforge username not defined!" />
<fail unless="sfproject" message="Sourceforge project name not defined!" />
<fail unless="sffilepath" message="Sourceforge project file path not defined!" />
</target>
</project>