-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·98 lines (86 loc) · 1.73 KB
/
build.sh
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
#!/bin/bash
# Define RELEASE=1 before running to build a release.
echo "Downloading and updating compiler..."
if git clone https://github.com/Feodor0090/j2me_compiler.git 2>/dev/null
then
echo "Done."
else
echo "Already downloaded."
fi
cd j2me_compiler
git pull
cd ..
cp Application\ Descriptor manifest.mf
WORK_DIR=`dirname $0`
cd ${WORK_DIR}
chmod +x ./build_sub.sh
mkdir -p jar
if [[ ${RELEASE} == "1" ]]
then
echo Filtering sid data...
for file in `find ./ -type f -name "*.java"`
do
if grep -q "??sidonly" $file
then
rm $file
else
cat $file | grep -v "?sid" > ./temp.txt
cat ./temp.txt > $file
fi
done
rm ./temp.txt
else
echo -en "Commit: " >> manifest.mf
git rev-parse --short HEAD >> manifest.mf
fi
APP=nmania_debug ./build_sub.sh
if [ $? -eq 0 ]
then
echo "Build OK!"
else
exit 1
fi
echo Filtering debug data...
for file in `find ./ -type f -name "*.java"`
do
if grep -q "??dbgonly" $file
then
rm $file
else
cat $file | grep -v "GL.Log" | grep -v "nmania.GL" | grep -v "?dbg" > ./temp.txt
cat ./temp.txt > $file
fi
done
rm ./temp.txt
APP=nmania ./build_sub.sh
if [ $? -eq 0 ]
then
echo "Build OK!"
else
exit 1
fi
echo Filtering full data...
for file in `find ./ -type f -name "*.java"`
do
if grep -q "??fullonly" $file
then
rm $file
else
cat $file | grep -v "// ?full" > ./temp.txt
cat ./temp.txt > $file
fi
done
rm ./temp.txt
rm ./res/sfx/*
APP=nmania_lite ./build_sub.sh
if [ $? -eq 0 ]
then
echo "Build OK!"
else
exit 1
fi
cp nmania.jar ./jar/nmania.jar
cp nmania_debug.jar ./jar/nmania_debug.jar
cp nmania_lite.jar ./jar/nmania_lite.jar
git rev-parse --short HEAD > ./jar/commit.txt
git branch | grep \* | cut -d ' ' -f2- > ./jar/branch.txt