-
Notifications
You must be signed in to change notification settings - Fork 207
/
release
executable file
·399 lines (344 loc) · 10.6 KB
/
release
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
#!/bin/bash
# release
#
#{{IS_NOTE
# Purpose:
#
# Description:
#
# History:
# Mon Nov 14 14:29:09 2005, Created by tomyeh
#}}IS_NOTE
#
#Copyright (C) 2005 Potix Corporation. All Rights Reserved.
#
#{{IS_RIGHT
#}}IS_RIGHT
#
stamp=$(date +%Y-%m-%d)
target=$1
setting=build.setting.local
if [ ! -f $setting ] ; then
setting=build.setting
if [ ! -f $setting ] ; then
echo $setting must be specified
exit 1
fi
fi
javadocdir=$(grep '^javadoc' $setting)
javadocdir=${javadocdir#javadoc=}
if [ "$javadocdir" = "" ] ; then
echo javadoc must be specified in $setting
exit 1
fi
javadocdir=${javadocdir/\~/$HOME}
if [ ! -d "$javadocdir" ] ; then
echo $javadocdir is not found
exit 1
fi
if [ "$target" == "official" ] ; then
htmldocdir=$(grep '^htmldoc' $setting)
htmldocdir=${htmldocdir#htmldoc=}
if [ "$htmldocdir" = "" ] ; then
echo htmldoc must be specified in $setting
exit 1
fi
htmldocdir=${htmldocdir/\~/$HOME}
if [ ! -d "$htmldocdir/devguide" ] ; then
echo $htmldocdir/devguide is not found
exit 1
fi
fi
ver=$(grep '^version=' $setting)
ver=${ver#version=}
#jar
if [ "$target" == "official" ] ; then
binnm=zk-bin-$ver
stdnm=zk-bin-std-$ver
profnm=zk-bin-prof-$ver
demonm=zk-demo-$ver
javadocnm=zk-javadoc-$ver
srcnm=zk-src-$ver
echo "Release $binnm..."
elif [ "$target" == "" ] || [ "$target" == "daily" ] ; then
target=daily
binnm=zk-bin-$ver-$stamp
demonm=zk-demo-$ver-$stamp
javadocnm=zk-javadoc-$ver-$stamp
srcnm=zk-src-$ver-$stamp
docnm=zk-doc-$ver-$stamp
echo "Release $binnm..."
else
echo "Usage: release [ official | daily ]"
echo Default: daily
exit 1
fi
rm -rf /tmp/zk
maindir="$(pwd)"
echo "Working directory $maindir"
#build *-all.war *-all.ear
if [ "$target" == "official" ] ; then
rm -rf dist/lib/zkdemo*.war dist/lib/zkdemos*.ear
cp -f zkdemo/war.libs.all zkdemo/war.libs
./build clean zkdemo zkdemos
./build zkdemo zkdemos
mv dist/lib/zkdemo.war dist/lib/zkdemo-all.war
mv dist/lib/zkdemos.ear dist/lib/zkdemos-all.ear
cp -f zkdemo/war.libs.minimal zkdemo/war.libs
./build clean zkdemo zkdemos
./build zkdemo zkdemos
fi
#Prepare the source codes
if [ "$target" == "official" ] || [ "$target" == "daily" ] ; then
#mkdir -p /tmp/zk/$srcnm/dist/lib/ext
mkdir -p /tmp/zk/$srcnm/bin
mkdir -p /tmp/zk/$srcnm/doc
echo Prepare ${srcnm}.tar.gz
cd $maindir
cp bin/* /tmp/zk/$srcnm/bin
cp build* /tmp/zk/$srcnm
cp -rp bin /tmp/zk/$srcnm
cp -rp zcommon /tmp/zk/$srcnm
cp -rp zweb /tmp/zk/$srcnm
cp -rp zk /tmp/zk/$srcnm
cp -rp zul /tmp/zk/$srcnm
cp -rp zhtml /tmp/zk/$srcnm
cp -rp zml /tmp/zk/$srcnm
cp -rp zkex /tmp/zk/$srcnm
cp -rp zkmax /tmp/zk/$srcnm
cp -rp zkplus /tmp/zk/$srcnm
cp zkdoc/COPYING zkdoc/release-note zkdoc/how-to-build-zk /tmp/zk/$srcnm/doc
cd /tmp/zk/$srcnm
rm -rf zcommon/debug zweb/debug zk/debug zul/debug zhtml/debug
rm -rf zml/debug zkex/debug zkmax/debug zkplus/debug
find -name .svn | xargs rm -rf
cd /tmp/zk
echo Output ${srcnm}.tar.gz
tar zcf ${srcnm}.tar.gz $srcnm
#prepare *-sources.jar
echo Prepare '*-sources.jar'
mkdir -p src/zcommon
mkdir -p src/zweb
mkdir -p src/zk
mkdir -p src/zul
mkdir -p src/zhtml
mkdir -p src/zml
mkdir -p src/zkex
mkdir -p src/zkmax
mkdir -p src/zkplus
cd $srcnm
cp -rp zcommon/codegen/* zcommon/src/* ../src/zcommon
cp -rp zweb/codegen/* zweb/src/* ../src/zweb
cp -rp zk/codegen/* zk/src/* ../src/zk
cp -rp zul/codegen/* zul/src/* ../src/zul
cp -rp zhtml/codegen/* zhtml/src/* ../src/zhtml
cp -rp zml/codegen/* zml/src/* ../src/zml
cp -rp zkex/codegen/* zkex/src/* ../src/zkex
cp -rp zkmax/codegen/* zkmax/src/* ../src/zkmax
cp -rp zkplus/codegen/* zkplus/src/* ../src/zkplus
cd ..
rm -rf $srcnm
rm -rf src/*/archive src/*/export
echo Output '*-sources.jar'
cd src
find -name 'package.html' | xargs rm -rf
jar cfM zcommon-sources.jar -C zcommon .
jar cfM zweb-sources.jar -C zweb .
jar cfM zk-sources.jar -C zk .
jar cfM zul-sources.jar -C zul .
jar cfM zhtml-sources.jar -C zhtml .
jar cfM zml-sources.jar -C zml .
jar cfM zkex-sources.jar -C zkex .
jar cfM zkmax-sources.jar -C zkmax .
jar cfM zkplus-sources.jar -C zkplus .
chmod 644 *.jar
mv *-sources.jar ..
cd ..
rm -rf src
#Prepare the binary release
mkdir -p /tmp/zk/$binnm/dist/lib/ext
mkdir -p /tmp/zk/$binnm/dist/lib/zkforge
mkdir -p /tmp/zk/$binnm/dist/WEB-INF/tld/jsp/zul
mkdir -p /tmp/zk/$binnm/dist/xsd
mkdir -p /tmp/zk/$binnm/dist/src
mkdir -p /tmp/zk/$binnm/doc
cd $maindir
mv -f /tmp/zk/*-sources.jar /tmp/zk/$binnm/dist/src
cp dist/lib/ext/commons-fileupload.jar dist/lib/ext/commons-io.jar /tmp/zk/$binnm/dist/lib/ext
#Fileupload
cp dist/lib/ext/jcommon.jar dist/lib/ext/jfreechart.jar /tmp/zk/$binnm/dist/lib/ext
#jFreeChart
cp dist/lib/ext/Filters.jar /tmp/zk/$binnm/dist/lib/ext
#captcha
cp dist/lib/ext/bsh.jar /tmp/zk/$binnm/dist/lib/ext
#BeanShell
cp dist/lib/ext/js.jar /tmp/zk/$binnm/dist/lib/ext
#JavaScript (rhino)
cp dist/lib/ext/groovy.jar /tmp/zk/$binnm/dist/lib/ext
#Groovy
cp dist/lib/ext/jruby.jar /tmp/zk/$binnm/dist/lib/ext
#Ruby (jruby)
cp dist/lib/ext/jython.jar /tmp/zk/$binnm/dist/lib/ext
#Python (jython)
cp dist/lib/ext/mvel.jar /tmp/zk/$binnm/dist/lib/ext
#MVEL
cp dist/lib/ext/ognl.jar /tmp/zk/$binnm/dist/lib/ext
#OGNL
cp dist/lib/ext/jasperreports.jar dist/lib/ext/itext.jar dist/lib/ext/jxl.jar dist/lib/ext/poi.jar dist/lib/ext/commons-collections.jar dist/lib/ext/commons-logging.jar /tmp/zk/$binnm/dist/lib/ext
#JasperReport
cp dist/lib/zcommon.jar dist/lib/zcommons-el.jar dist/lib/zweb.jar /tmp/zk/$binnm/dist/lib/
cp dist/lib/zk.jar dist/lib/zul.jar dist/lib/zhtml.jar dist/lib/zml.jar /tmp/zk/$binnm/dist/lib/
cp dist/lib/zkex.jar dist/lib/zkmax.jar dist/lib/zkplus.jar /tmp/zk/$binnm/dist/lib/
cp dist/lib/fckez.jar dist/lib/dojoz.jar dist/lib/gmapsz.jar /tmp/zk/$binnm/dist/lib/zkforge
cp dist/lib/timelinez.jar /tmp/zk/$binnm/dist/lib/zkforge
chmod 644 /tmp/zk/$binnm/dist/lib/*.jar
chmod 644 /tmp/zk/$binnm/dist/lib/*/*.jar
if [ -d dist/export/WEB-INF ] ; then
cp -rp dist/export/WEB-INF/* /tmp/zk/$binnm/dist/WEB-INF
fi
cp -rp zweb/src/archive/web/WEB-INF/tld/web /tmp/zk/$binnm/dist/WEB-INF/tld
cp -rp zk/src/archive/web/WEB-INF/tld/zk /tmp/zk/$binnm/dist/WEB-INF/tld
cp -rp zul/src/archive/web/WEB-INF/tld/zul /tmp/zk/$binnm/dist/WEB-INF/tld
cp zul/src/archive/metainfo/xml/*.xsd /tmp/zk/$binnm/dist/xsd
cp zkdoc/release-note zkdoc/COPYING /tmp/zk/$binnm/doc
chmod 644 /tmp/zk/$binnm/dist/xsd/*.xsd /tmp/zk/$binnm/doc/release-note /tmp/zk/$binnm/doc/COPYING
cd /tmp/zk/$binnm/dist/WEB-INF/tld
find -name .svn | xargs rm -rf
cd /tmp/zk
if [ "$target" == "official" ] ; then
echo Output ${binnm}.tar.gz
tar zcf ${binnm}.tar.gz $binnm
fi
echo Output ${binnm}.zip
zip -qr9 ${binnm}.zip $binnm
if [ "$target" == "official" ] ; then
#Prepare maven repository
function mvnrepo {
mkdir -p $1
cp /tmp/zk/$binnm/dist/src/$1-sources.jar $1/$1-$ver-sources.jar
sed -e "s/{version}/$ver/" $maindir/$1/pom.xml > $1/pom.xml
cp $maindir/dist/lib/$1.jar $1/$1-$ver.jar
jar cfM $1-$ver-bundle.jar -C $1 .
}
mkdir -p maven
mkdir -p /tmp/maven
cd maven
mvnrepo zcommon
mvnrepo zweb
mvnrepo zk
mvnrepo zul
mvnrepo zhtml
mvnrepo zml
mvnrepo zkex
mvnrepo zkmax
mvnrepo zkplus
mv *-bundle.jar /tmp/maven
cd ..
rm -rf maven
fi
if [ "$target" == "official" ] ; then
#Ouput ${profnm}
cd $binnm/dist/lib/ext
rm -rf js.jar groovy.jar jruby.jar jython.jar mvel.jar ognl.jar
cd ..
rm zkmax.jar
rm ../src/zkmax-sources.jar
cd zkforge
rm gmapsz.jar
cd /tmp/zk
if [ "$target" == "official" ] ; then
echo Output ${profnm}.tar.gz
tar zcf ${profnm}.tar.gz $binnm
fi
echo Output ${profnm}.zip
zip -qr9 ${profnm}.zip $binnm
#Ouput ${stdnm}
cd $binnm/dist/lib/ext
rm -rf jcommon.jar jfreechart.jar Filters.jar
rm -rf jasperreports.jar itext.jar jxl.jar poi.jar commons-collections.jar commons-logging.jar
cd ..
rm zml.jar
rm zkex.jar
rm ../src/zml-sources.jar
rm ../src/zkex-sources.jar
cd zkforge
rm dojoz.jar
rm fckez.jar
rm timelinez.jar
cd /tmp/zk
if [ "$target" == "official" ] ; then
echo Output ${stdnm}.tar.gz
tar zcf ${stdnm}.tar.gz $binnm
fi
echo Output ${stdnm}.zip
zip -qr9 ${stdnm}.zip $binnm
fi
rm -rf $binnm
#Prepare the java doc
cd $javadocdir
echo Output ${javadocnm}.zip
zip -qr9 ${javadocnm}.zip zcommon zweb zk zul zhtml zml zkex zkmax zkplus
mv ${javadocnm}.zip /tmp/zk
mkdir -p /tmp/zk/$demonm/zkdemo/WebContent
mkdir -p /tmp/zk/$demonm/zkdemo/src/org
mkdir -p /tmp/zk/$demonm/MyApp/WebContent
mkdir -p /tmp/zk/$demonm/doc
cd $maindir
cp -rp zkdemo/src/archive/* /tmp/zk/$demonm/zkdemo/WebContent
#cp -rp zkdemo/codegen/archive/* /tmp/zk/$demonm/zkdemo/WebContent
cp -rp zkdemo/src/org/* /tmp/zk/$demonm/zkdemo/src/org
cp -rp MyApp/src/archive/* /tmp/zk/$demonm/MyApp/WebContent
cp zkdoc/COPYING zkdoc/release-note /tmp/zk/$demonm/doc
cp dist/lib/zkdemo.war /tmp/zk/$demonm/zkdemo-min.war
if [ "$target" == "official" ] ; then
mv dist/lib/zkdemos.ear /tmp/zk/$demonm/zkdemos-min.ear
mv dist/lib/zkdemo-all.war /tmp/zk/$demonm/zkdemo.war
mv dist/lib/zkdemos-all.ear /tmp/zk/$demonm/zkdemos.ear
fi
cd /tmp/zk
find -name .svn | xargs rm -rf
echo Output ${demonm}.zip
zip -qr9 ${demonm}.zip $demonm
rm -rf $demonm
fi
#Prepare the doc
if [ "$target" == "official" ]; then
mkdir -p /tmp/zk/doc
cd $maindir/zkdoc
for f in */ZK-quickstart*.pdf ; do
fn=${f%.pdf}
cp $f /tmp/zk/doc/${fn#**/}-$ver.pdf
done
cd /tmp/zk/doc
cp -rP $htmldocdir/devref $htmldocdir/devguide $htmldocdir/devref-single $htmldocdir/devguide-single .
find -name .svn | xargs rm -rf
echo Output zk-devref-$ver.zip
mv devref zk-devref-$ver
zip -qr9 zk-devref-$ver.zip zk-devref-$ver
rm -rf zk-devref-$ver
echo Output zk-devguide-$ver.zip
mv devguide zk-devguide-$ver
zip -qr9 zk-devguide-$ver.zip zk-devguide-$ver
rm -rf zk-devguide-$ver
echo Output zk-devref-single-$ver.zip
mv devref-single zk-devref-single-$ver
zip -qr9 zk-devref-single-$ver.zip zk-devref-single-$ver
rm -rf zk-devref-single-$ver
echo Output zk-devguide-single-$ver.zip
mv devguide-single zk-devguide-single-$ver
zip -qr9 zk-devguide-single-$ver.zip zk-devguide-single-$ver
rm -rf zk-devguide-single-$ver
elif [ "$target" == "daily" ]; then
mkdir -p /tmp/zk/$docnm/devguide
mkdir -p /tmp/zk/$docnm/devref
cd $maindir
cp zkdoc/*/ZK-quickstart*.pdf /tmp/zk/$docnm
cp -rp zkdoc/devguide/*.odt zkdoc/devguide/images /tmp/zk/$docnm/devguide
cp -rp zkdoc/devref/*.odt zkdoc/devref/images /tmp/zk/$docnm/devref
cp zkdoc/release-note zkdoc/COPYING /tmp/zk/$docnm
cd /tmp/zk
find -name .svn | xargs rm -rf
echo Ouput ${docnm}.zip
zip -qr9 ${docnm}.zip $docnm
rm -rf $docnm
fi