forked from deltaluca/nape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·212 lines (184 loc) · 4.63 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
#!/bin/bash
WORKING=".version.cur"
if [ ! -e $WORKING ]
then
cp version $WORKING
fi
function read {
MAJOR=`sed -n '1p' $WORKING`
MINOR=`sed -n '2p' $WORKING`
REVISION=`sed -n '3p' $WORKING`
DATETIME=`sed -n '4p' $WORKING`
}
read
function write {
echo $MAJOR > $WORKING
echo $MINOR >> $WORKING
echo $REVISION >> $WORKING
echo $DATETIME >> $WORKING
}
function cver {
CVERSION="$MAJOR.$MINOR"
if [ "$REVISION" != 0 ]
then
CVERSION="$CVERSION \"r$REVISION\" $DATETIME"
fi
}
if [ "$1" = 'reset' ]
then
cp version $WORKING
read
cver
echo " >> now at $CVERSION"
elif [ "$1" = 'incminor' ]
then
MINOR=$((MINOR+1))
REVISION=0
DATETIME=""
write
cver
echo " >> now at $CVERSION"
elif [ "$1" = 'inc' ]
then
MAJOR=$((MAJOR+1))
MINOR=1
REVISION=0
DATETIME=""
write
cver
echo " >> now at $CVERSION"
exit
elif [ "$1" = 'make' ]
then
oldREVISION=$REVISION
oldDATETIME=$DATETIME
REVISION=$((REVISION+1))
DATETIME=`date +"%d/%m/%y %H:%M"`
write
echo ""
echo "------------------------------------------------------------------------------"
echo " >> Checking libraries compile (exec 'make release') "
echo "------------------------------------------------------------------------------"
echo ""
make release
success=$?
if [ "$success" = "0" ]
then
#check demoes all compile
echo ""
echo "------------------------------------------------------------------------------"
echo " >> Checking demoes all compile (exec './demo/testrun') "
echo "------------------------------------------------------------------------------"
echo ""
cd demo
./testrun
success=$?
cd ../
fi
if [ "$success" = "0" ]
then
#check unit tests pass
echo ""
echo "------------------------------------------------------------------------------"
echo " >> Checking unit tests still pass (exec './unit/testrun')"
echo "------------------------------------------------------------------------------"
echo ""
cd unit
./testrun
success=$?
cd ../
fi
if [ "$success" != "0" ]
then
echo ""
echo " >> FAILURE"
REVISION=$oldREVISION
DATETIME=$oldDATETIME
write
else
make tar
cver
echo ""
echo "------------------------------------------------------------------------------"
echo " >> now at $CVERSION"
echo "------------------------------------------------------------------------------"
echo ""
cp $WORKING version
#copy over demo docs stuff
echo ""
echo "------------------------------------------------------------------------------"
echo " >> copying demo doc shiz (exec './demo/gendocs')"
echo "------------------------------------------------------------------------------"
echo ""
cd demo
./gendocs
cd ../
#rebuild docs fully (to have proper links)
echo ""
echo "------------------------------------------------------------------------------"
echo " >> rebuilding docs for changes to demoes and index"
echo " (exec './doc-gen/make build && ./doc-gen/make run')"
echo "------------------------------------------------------------------------------"
echo ""
cd doc-gen
make build
make run
cd ../
#ftp shiz
echo ""
echo "------------------------------------------------------------------------------"
echo " >> starting ftp transfers to deltaluca.me.uk"
echo "------------------------------------------------------------------------------"
echo ""
ftp -n -v deltaluca.me.uk << EOT
user luca $PASS
prompt
cd public_html/docnew/
lcd doc-gen/doc/
put index.php
cd swf
lcd swf
mput *
exit
EOT
echo " server remotes <<< "
make server-release
#haxelib
echo ""
echo "--------------------------------------------------------------------------"
echo " >> haxelib"
echo "--------------------------------------------------------------------------"
echo ""
cd src
read -e -p "haxelib message:
> " haxelibmsg
cat > haxelib.xml << EOT
<project name="nape" url="https://github.com/deltaluca/nape" license="BSD">
<user name="deltaluca"/>
<tag v="cross"/>
<tag v="game"/>
<description>Nape 2D Physics engine</description>
<version name="m$MAJOR.$MINOR-r$REVISION">$haxelibmsg</version>
</project>
EOT
rm napelib.zip
zip -r napelib .
haxelib submit napelib.zip
cd ../
rm $WORKING
fi
exit
elif [ "$1" = 'version' ]
then
cver
echo $CVERSION
exit
else
echo "Script for working with public releases of nape for development"
echo " >> 'version' to query current public version"
echo " >> 'incminor' to increment minor version (reset revision to 1)"
echo " >> 'inc' to increment major version (reset minor to 1)"
echo " >> 'make' to run 'make release' aswell as incrementing revision and performing ftp work"
echo " >> 'reset' to undo staged changes"
exit
fi