-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildscript.common
executable file
·38 lines (36 loc) · 1.12 KB
/
buildscript.common
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
#!/bin/bash -ex
MAINDIR=buildtmp/${OXPNAME}_$VERSION
OXPDIR=buildtmp/${OXPNAME}_$VERSION/${OXPNAME}_$VERSION.oxp
TESTDIR=~/.Oolite/AddOns/${OXPNAME}.oxp
TESTFILE=~/.Oolite/AddOns/${OXPNAME}.oxz
DISTFILE=${OXPNAME}_$VERSION.zip
OXZFILE=${OXPNAME}_$VERSION.oxz
YEAR=`date +%Y`
rm -f $DISTFILE
rm -f $OXZFILE
rm -rf buildtmp
mkdir -p buildtmp
sed -e "s/VERSION/$VERSION/" < scriptheader.js | sed -e "s/YEAR/2011-$YEAR/" > buildtmp/scriptheader.js
mkdir -p $MAINDIR
mkdir -p $OXPDIR
cp readme.txt $MAINDIR
cp License.txt $MAINDIR
cp -r oxp/* $OXPDIR
if [ -f oxp/manifest.plist ] ; then
sed -e "s/VERSION/$VERSION/" < oxp/manifest.plist > $OXPDIR/manifest.plist
# cp $OXPDIR/manifest.plist ./manifest.$VERSION.plist
fi
find $MAINDIR -name \*~ -delete
if [ -d $OXPDIR/Scripts ] ; then
find $OXPDIR/Scripts -name \*.js -exec ./buildjs.sh '{}' ';'
fi
cd buildtmp
zip -9rq ../$DISTFILE ${OXPNAME}_$VERSION
cd ../$OXPDIR
zip -9rq ../../../$OXZFILE *
cd ../../..
rm -rf $TESTDIR $TESTFILE
cp $OXZFILE $TESTFILE
# Change the path below and uncomment the line to enable OXP verification
# (strongly recommended!)
# ~/path/to/oolite/oolite --verify-oxp $OXPDIR