-
Notifications
You must be signed in to change notification settings - Fork 4
/
release
executable file
·269 lines (212 loc) · 6.01 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
#!/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
#
maindir="$(pwd)"
cd $maindir
echo "Working directory $maindir"
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
javadocdir=${javadocdir/\~/$HOME}
#if [ ! -d "$javadocdir/jsdoc" ] ; then
# echo $javadocdir/jsdoc is not found
# exit 1
#fi
ver=$(grep '^version=' $setting)
ver=${ver#version=}
#jar
if [ "$target" == "official" ] ; then
binnm=zest-bin-$ver
demonm=zest-demo-$ver
javadocnm=zest-javadoc-$ver
# jsdocnm=zest-jsdoc-$ver
srcnm=zest-src-$ver
elif [ "$target" == "" ] || [ "$target" == "daily" ] ; then
target=daily
binnm=zest-bin-$ver-$stamp
demonm=zest-demo-$ver-$stamp
javadocnm=zest-javadoc-$ver-$stamp
# jsdocnm=zest-jsdoc-$ver-$stamp
srcnm=zest-src-$ver-$stamp
else
echo "Usage: release [ official | daily ]"
echo Default: daily
exit 1
fi
echo "Release $binnm..."
rm -rf /tmp/zest
rm -rf /tmp/maven
#build zest.jar
./build clean zest
./build zest
#build *-all.war
rm -rf dist/lib/zest-examples*.war
cp -f zest-examples/war.libs.all zest-examples/war.libs
./build clean zest-examples
./build zest-examples
mv dist/lib/zest-examples.war dist/lib/zest-examples-all.war
cp -f zest-examples/war.libs.minimal zest-examples/war.libs
./build clean zest-examples
./build zest-examples
#Prepare the source codes
if [ "$target" == "official" ] || [ "$target" == "daily" ] ; then
mkdir -p /tmp/zest/$srcnm/bin
mkdir -p /tmp/zest/$srcnm/dist/src
mkdir -p /tmp/zest/$srcnm/doc
chmod -R 755 $maindir
echo Prepare ${srcnm}.zip
cd $maindir
cp bin/* /tmp/zest/$srcnm/bin
cp build* /tmp/zest/$srcnm
cp -rp bin /tmp/zest/$srcnm
cp -rp zest /tmp/zest/$srcnm
cp doc/COPYING doc/release-note /tmp/zest/$srcnm/doc
cd /tmp/zest/$srcnm
rm -rf zest/debug
find . -name .svn | xargs rm -rf
cd /tmp/zest
#prepare *-sources.jar
echo Prepare '*-sources.jar'
mkdir -p src/zest
cd $srcnm
cp -rp zest/codegen/* zest/src/* ../src/zest
cd ..
rm -rf src/*/archive
echo Output '*-sources.jar'
cd src
find . -name 'package.html' | xargs rm -rf
jar cfM zest-sources.jar -C zest .
chmod 644 *.jar
mv *-sources.jar ..
cd ..
rm -rf src
cd $maindir
mv -f /tmp/zest/*-sources.jar /tmp/zest/$srcnm/dist/src
cd /tmp/zest
echo Output ${srcnm}.zip
zip -qr9 ${srcnm}.zip $srcnm
#Prepare the binary release
mkdir -p /tmp/zest/$binnm/dist/lib
#mkdir -p /tmp/zest/$binnm/dist/WEB-INF/tld/
#mkdir -p /tmp/zest/$binnm/dist/xsd
mkdir -p /tmp/zest/$binnm/doc
cd $maindir
#mv -f /tmp/zest/*-sources.jar /tmp/zest/$binnm/dist/src
cp dist/lib/ext/zcommon.jar dist/lib/ext/zcommons-el.jar dist/lib/ext/zweb.jar /tmp/zest/$binnm/dist/lib/
cp dist/lib/zest.jar /tmp/zest/$binnm/dist/lib/
chmod 644 /tmp/zest/$binnm/dist/lib/*.jar
#chmod 644 /tmp/zest/$binnm/dist/lib/*/*.jar
#cp -rp zest/src/archive/web/WEB-INF/tld/web /tmp/zest/$binnm/dist/WEB-INF/tld
#cp zest/src/archive/metainfo/xml/*.xsd /tmp/zest/$binnm/dist/xsd
cp doc/COPYING doc/release-note /tmp/zest/$binnm/doc
#chmod 644 /tmp/zest/$binnm/dist/xsd/*.xsd
chmod 644 /tmp/zest/$binnm/doc/release-note
cd /tmp/zest/$binnm/doc
find . -name .svn | xargs rm -rf
#cd /tmp/zest/$binnm/dist/WEB-INF
#find . -name .svn | xargs rm -rf
cd /tmp/zest
#Prepare maven repository
function mvnrepo {
if [ "$target" == "official" ] ; then
local vertamp=`echo $ver | sed 's/-/./'`
else
local vertamp=`echo $ver | sed 's/-/./'`.$(date +%Y%m%d)
fi
mkdir -p $1
local fileName=$1
if [ $2 ] ; then
cp /tmp/zest/$srcnm/dist/src/$1-sources.jar $1/$1-$vertamp-sources.jar
elif [ -f "$maindir/dist/lib/$1.nosrc.jar" ] ; then
fileName=$1.nosrc
fi
sed -e "s/zk.version>.*<\/zk.version/zk.version>$vertamp<\/zk.version/" $maindir/$1/pom.xml > $maindir/$1/pom2.xml
mv -f $maindir/$1/pom2.xml $maindir/$1/pom.xml
if [ "$1" != "zest-examples" ] ; then
sed -e "s/\${zk.version}/$vertamp/" $maindir/$1/pom.xml > $1/pom.xml
cp $maindir/dist/lib/$fileName.jar $1/$1-$vertamp.jar
jar cfM $1-$vertamp-bundle.jar -C $1 .
fi
}
mkdir -p maven
mkdir -p /tmp/maven
cd maven
mvnrepo zest true
mvnrepo zest-examples
mv *-bundle.jar /tmp/maven
cd ..
rm -rf maven
mkdir -p /tmp/zest/$binnm/dist/src
cp /tmp/zest/$srcnm/dist/src/* /tmp/zest/$binnm/dist/src/
#Ouput ${binnm}
cp $maindir/doc/COPYING /tmp/zest/$binnm/doc
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
rm -rf $binnm
rm -rf metainfo
rm -rf $srcnm
rm -rf $binnm
#Prepare the java doc
cd $javadocdir
echo Output ${javadocnm}.zip
zip -qr9 ${javadocnm}.zip zest
mv ${javadocnm}.zip /tmp/zest
#Prepare the JS doc
#echo Output ${jsdocnm}.zip
#zip -qr9 ${jsdocnm}.zip jsdoc
#mv ${jsdocnm}.zip /tmp/zest
mkdir -p /tmp/zest/$demonm/zest-examples/WebContent
mkdir -p /tmp/zest/$demonm/zest-examples/src/org
mkdir -p /tmp/zest/$demonm/doc
cd $maindir
cp -rp zest-examples/src/archive/* /tmp/zest/$demonm/zest-examples/WebContent
#cp -rp zest-examples/codegen/archive/* /tmp/zest/$demonm/zest-examples/WebContent
cp -rp zest-examples/src/org/* /tmp/zest/$demonm/zest-examples/src/org
cp doc/COPYING doc/release-note /tmp/zest/$demonm/doc
cp dist/lib/zest-examples.war /tmp/zest/$demonm/zest-examples-min.war
cd /tmp/zest/$demonm/doc
find . -name .svn | xargs rm -rf
cd $maindir
mv dist/lib/zest-examples-all.war /tmp/zest/$demonm/zest-examples.war
cd /tmp/zest
find . -name .svn | xargs rm -rf
echo Output ${demonm}.zip
zip -qr9 ${demonm}.zip $demonm
rm -rf $demonm
fi