forked from soot-oss/soot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nightly
executable file
·318 lines (270 loc) · 11.9 KB
/
nightly
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
#!/bin/bash
# This script makes nightly builds of Soot, Jasmin, Polyglot and other closely
# related projects. There are several set up issues required to use it
# First you must set up an autobuild directory with three sub-directories
# settings, releases and resources.
# In the settings directory put a soot and a jasmin base settings file
# This is used to derive the ant.settings file needed to build Soot and
# Jasmin (one each)
# In the resources directory you need at least a copy of Eclipse.
# The Soot Eclipse plugin builds againts any 2.1.x version of Eclipse.
# You also need a sym link to the base nightly build html file.
# The releases directory can be empty
rm -rf $HOME/autobuild/tmp;
rm -rf /tmp/autobuild;
mkdir /tmp/autobuild;
ln -s /tmp/autobuild $HOME/autobuild/tmp;
cd $HOME/autobuild/tmp;
#export CLASSPATH=
export PATH=/usr/localcc/bin:$PATH
#export JAVA_HOME=/usr/local/j2sdk1.4.2_01
polyglotrev=1.3.5;
rev=2.5.0;
# use this if building and using most recent polyglot
function getNightlyPolyglot(){
# get polyglot from cvs
cvs -Q -d :pserver:[email protected]:/cvsroot checkout polyglot || return;
}
#use this if using stable, released polyglot
function getReleasedPolyglot(){
# get released polyglot from resources
cp -r $HOME/autobuild/resources/polyglot-$polyglotrev-src $HOME/autobuild/tmp/polyglot || return;
}
# export jasmin and soot from subversion
function getJasminAndSoot(){
# get jasmin, soot in autobuild/tmp dir
svn export https://svn.sable.mcgill.ca/soot/jasmin/trunk jasmin > jasmin_export || return;
svn export -q https://svn.sable.mcgill.ca/soot/soot/trunk soot || return;
}
function getJastAdd() {
svn export -q http://svn.cs.lth.se/svn/jastadd-oxford/projects/trunk/JastAddJ
svn export -q http://svn.cs.lth.se/svn/jastadd-oxford/projects/trunk/JastAddExtensions/
}
# set up date and revision tags
function getCurrentDate(){
polyglotrev=`date +%Y%m%d` || return;
echo "Date: $polyglotrev" || return;
}
# get current jasmin/soot revision
function getJasminSootRevision(){
rev=`tail -1 jasmin_export | sed s/Exported' 'revision' '// | sed s/\\\.//` || return;
rm jasmin_export || return;
echo "Revision $rev" || return;
}
# build polyglot src jars
function buildPolyglotBarebones(){
# switch to tmp dir
cd $HOME/autobuild/tmp || return;
# make a polyglot barebones jar and tar
jar -cf $HOME/autobuild/releases/polyglotsrc-$polyglotrev.jar polyglot || return;
tar -czf $HOME/autobuild/releases/polyglotsrc-$polyglotrev.tar.gz polyglot || return;
echo "Built polyglot src packages." || return;
}
# build polyglot classes jars
function buildPolyglotClasses(){
# switch to polyglot dir and build it first
cd $HOME/autobuild/tmp/polyglot || return;
if !(ant); then
# if polyglot won't build send mail
# include date
echo "Polyglot will not build $polyglotrev" | /usr/bin/mutt [email protected] -e 'set from = [email protected]' -s "Soot Automated Nightly Build" || return;
echo "Polyglot will not build $polyglotrev" || return;
else
# make polyglot jar out of classes and cup classes
cd $HOME/autobuild/tmp/polyglot/classes || return;
jar -cf $HOME/autobuild/releases/polyglotclasses-$polyglotrev.jar * || return;
cd $HOME/autobuild/tmp/polyglot/cup-classes || return;
jar -uf $HOME/autobuild/releases/polyglotclasses-$polyglotrev.jar * || return;
fi
}
# set up jasmin
function setUpJasmin(){
# switch to jasmin dir and set cup variable to polyglot jar and build
cd $HOME/autobuild/tmp/jasmin || return;
# cp jasmin settings file
sed s/cup-classes\\//autobuild\\/releases\\/polyglotclasses-$polyglotrev.jar/ $HOME/autobuild/settings/jasmin | sed s/2.2.1/$rev/ > ant.settings || return;
# update version in source in jasmin
sed s/version' '=' '\"2.2.1\"/version' '=' '\"$rev\"/ src/jasmin/Main.java > version-temp || return;
mv version-temp src/jasmin/Main.java || return;
}
# build the jasmin src jar and tar files
function buildJasminBarebones(){
cd $HOME/autobuild/tmp/jasmin || return;
ant barebones || return;
}
# build jasmin classes
function buildJasminClasses(){
cd $HOME/autobuild/tmp/jasmin || return;
if !(ant jasmin-jar); then
# send mail if something is broken - add revision number
echo "Jasmin will not build $rev" | /usr/bin/mutt [email protected] -e 'set from = [email protected]' -s "Soot Automated Nightly Build" || return;
echo "Jasmin will not build $rev" || return;
fi
}
# set up Soot
function setUpSoot(){
# switch to soot
cd $HOME/autobuild/tmp/soot || return;
# cp soot settings file
sed s/polyglotjar/autobuild\\/releases\\/polyglotclasses-$polyglotrev.jar/ $HOME/autobuild/settings/soot | sed s/jasminjar/autobuild\\/releases\\/jasminclasses-$rev.jar/ | sed s/sootversion/$rev/ > ant.settings || return;
# update version in source in soot
sed s/versionString' '=' '\"2.2.1\"/versionString' '=' '\"$rev\"/ src/soot/Main.java > version-temp || return;
mv version-temp src/soot/Main.java || return;
# some care must be given to ensure the eclipse plugin.xml
# file has the right jar file names for soot, jasmin and polyglot
cd $HOME/autobuild/tmp/soot/eclipse/ca.mcgill.sable.soot/ || return;
sed s/sootclasses-2.2.1-custom.jar/sootclasses-$rev.jar/ plugin.xml > temp1 || return;
sed s/jasminclasses-2.2.1.jar/jasminclasses-$rev.jar/ temp1 | sed s/polyglotclasses-1.3.jar/polyglotclasses-$polyglotrev.jar/ > plugin.xml || return;
rm temp1 || return;
}
# build soot src jars
function buildSootBarebones(){
# build soot src jar and tar files
cd $HOME/autobuild/tmp/soot || return;
ant barebones || return;
}
# build soot classes
function buildSootClasses(){
cd $HOME/autobuild/tmp/soot || return;
if !(ant fulljar); then
# if something is broken send mail
echo "Soot will not build $rev" | /usr/bin/mutt [email protected] -e 'set from = [email protected]' -s "Soot Automated Nightly Build" || return;
echo "Soot will not build $rev" || return;
fi
}
# build soot javadoc
function buildSootJavaDoc(){
cd $HOME/autobuild/tmp/soot || return;
ant javadoc || return;
}
# build soot tutorials
function buildSootTutorials(){
cd $HOME/autobuild/tmp/soot/tutorial || return;
./generate_tutorial || return;
jar -cf $HOME/autobuild/releases/soot-tutorial-$rev.jar * || return;
tar -czf $HOME/autobuild/releases/soot-tutorial-$rev.tar.gz * || return;
}
# make complete jar includes src and classes for soot, jasmin, polyglot
# includes src and classes for plugin and complete src and built tutorial
# by this point in the script all of soot, jasmin and polyglot are built
function buildComplete(){
cd $HOME/autobuild/tmp || return;
mv soot soot-$rev || return;
mv jasmin jasmin-$rev || return;
mv polyglot polyglot-$polyglotrev || return;
jar -cf $HOME/autobuild/releases/sootall-$rev.jar soot-$rev jasmin-$rev polyglot-$polyglotrev || return;
tar -czf $HOME/autobuild/releases/sootall-$rev.tar.gz soot-$rev jasmin-$rev polyglot-$polyglotrev || return;
}
# update nightly build html file
function updateNightlyHtml(){
cd $HOME/autobuild/tmp/soot-$rev || return;
sed s/sootall/sootall-$rev/g nightly.html > temp1.html || return;
sed s/sootclasses/sootclasses-$rev/g temp1.html | sed s/jasminclasses/jasminclasses-$rev/g | sed s/polyglotclasses/polyglotclasses-$polyglotrev/g | sed s/quickstart/soot-eclipse-quickstart-$rev/g | sed s/sootbarebones/sootsrc-$rev/g | sed s/jasminbarebones/jasminsrc-$rev/g | sed s/polyglotbarebones/polyglotsrc-$polyglotrev/g > nightly.html || return;
rm temp1.html || return;
cp nightly.html $HOME/autobuild/releases/ || return;
cd $HOME/autobuild/releases/ || return;
chmod o+r nightly.html || return;
chmod g+r nightly.html || return;
cp nightly.html ~sable/public_html/soot/ || return;
cp *$rev* ~sable/public_html/soot/nightly/ || return;
cp *$polyglotrev* ~sable/public_html/soot/nightly/ || return;
}
function makeStable(){
getReleasedPolyglot || exit;
getJasminAndSoot || exit;
getJastAdd || exit;
buildPolyglotBarebones || exit;
buildPolyglotClasses || exit;
setUpJasmin || exit;
buildJasminBarebones || exit;
buildJasminClasses || exit;
setUpSoot || exit;
buildSootBarebones || exit;
buildSootClasses || exit;
buildSootJavaDoc || exit;
buildSootTutorials || exit;
buildComplete || exit;
# updateNightlyHtml || exit;
}
function makeNightly(){
getReleasedPolyglot || exit;
getJasminAndSoot || exit;
#getCurrentDate;
getJasminSootRevision || exit;
buildPolyglotBarebones || exit;
buildPolyglotClasses || exit;
setUpJasmin || exit;
buildJasminBarebones || exit;
buildJasminClasses || exit;
setUpSoot || exit;
buildSootBarebones || exit;
buildSootClasses || exit;
buildSootJavaDoc || exit;
buildSootTutorials || exit;
buildComplete || exit;
updateNightlyHtml || exit;
}
makeStable
#makeNightly
#cd $HOME/autobuild &&
#cp settings/jasmin tmp/jasmin-trunk/ant.settings &&
#cp settings/jedd tmp/jedd-trunk/ant.settings &&
#cp settings/soot tmp/soot-trunk/ant.settings &&
#cp settings/paddle tmp/paddle-trunk/ant.settings &&
#cp settings/abc tmp/abc/ant.settings &&
#cd $HOME/autobuild/tmp &&
#cd jedd-trunk &&
#CLASSPATH=$HOME/autobuild/resources/cpptasks.jar ant &&
#cp $HOME/autobuild/tmp/jedd-trunk/runtime/lib/{jedd-runtime.jar,libjeddbuddy.so,libjeddcudd.so} $HOME/autobuild/releases &&
#cp $HOME/autobuild/tmp/jedd-trunk/translator/lib/jedd-translator.jar $HOME/autobuild/releases &&
#cd $HOME/autobuild/tmp &&
#cd jasmin-trunk &&
#ant &&
#cd $HOME/autobuild/tmp/jasmin-trunk/classes &&
#jar cf $HOME/autobuild/releases/jasminclasses.jar . &&
#( scp musk:/usr/local/src/polyglot-dev/lib/polyglot.jar $HOME/autobuild/resources &&
#scp musk:/usr/local/src/polyglot-dev/lib/java_cup.jar $HOME/autobuild/resources &&
#scp musk:/usr/local/src/xact/java/xact-complete.jar $HOME/autobuild/resources &&
#cd $HOME/autobuild/tmp &&
#mkdir polyglot &&
#cd $HOME/autobuild/tmp/polyglot &&
#jar xf $HOME/autobuild/resources/polyglot.jar &&
#jar xf $HOME/autobuild/resources/java_cup.jar &&
#jar cf $HOME/autobuild/resources/polyglot-cvs.jar .
#) ;
#cd $HOME/autobuild/tmp &&
#cd soot-trunk &&
#ant classesjar &&
#cd systests &&
#CLASSPATH=$HOME/autobuild/tmp/soot-trunk/classes:$HOME/autobuild/tmp/jasmin-trunk/classes:$HOME/autobuild/resources/polyglot-cvs.jar:.:/usr/localcc/pkgs/j2sdk1.4.2/jre/lib/rt.jar ./go &&
#cd $HOME/autobuild/tmp &&
#cd paddle-trunk &&
#ant classesjar &&
#cd $HOME/autobuild/tmp &&
#cd abc &&
#ant &&
#ant paddle-jar &&
#cp $HOME/autobuild/tmp/abc/lib/*.jar $HOME/autobuild/releases &&
#cd $HOME/autobuild/tmp &&
#cd abc &&
#cd ajc-harness &&
#cd tests &&
#export CLASSPATH=$HOME/autobuild/releases/abc.jar:$HOME/autobuild/releases/abc-testing.jar:$HOME/autobuild/releases/abc-runtime.jar:$HOME/autobuild/releases/sootclasses-nightly.jar:$HOME/autobuild/resources/polyglot-cvs.jar:$HOME/autobuild/releases/jasminclasses.jar &&
#java -Xmx768M -Dabc.home=$HOME/autobuild/tmp/abc abc.testing.Main abcTests.xml &&
#cd $HOME/autobuild/tmp &&
#cd abc &&
#cd ajc-harness &&
#cd tests &&
#./calc_updates.pl &&
#cd $HOME/autobuild/tmp &&
#cd abc &&
#cd ajc-harness &&
#cd tests &&
#export CLASSPATH=$HOME/debugabc/:$HOME/autobuild/releases/abc.jar:$HOME/autobuild/releases/abc-testing.jar:$HOME/autobuild/releases/abc-runtime.jar:$HOME/autobuild/releases/sootclasses-nightly.jar:$HOME/autobuild/resources/polyglot-cvs.jar:$HOME/autobuild/releases/jasminclasses.jar &&
#java -Xmx768M -Dabc.home=$HOME/autobuild/tmp/abc abc.testing.Main abcTests.xml &&
#cd $HOME/autobuild/tmp &&
#cd abc &&
#cd ajc-harness &&
#cd tests &&
#./calc_updates.pl | $HOME/bin/mutt [email protected] -e 'set from = [email protected]' -c [email protected] -s "test run results (with re-weaving)" &&
#true;