This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·65 lines (51 loc) · 1.57 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
#!/usr/bin/env bash
TMP_DIR=$(mktemp -d)
TARGET="${TMP_DIR}/BJS"
ORIGIN=${PWD}
USER_DOC_ID="1rs-JHlzbmmHCCYEuimnUzQ_-FFuJJH0THVy8FcDSrtc"
ARCHS=( "os.windows.x86_32" "os.osx.x86_64" "os.linux.x86_64" "os.linux.x86_32" )
function meteorBuild {
meteor build ${TARGET}/$1 --architecture $1 --server-only
}
function decompress {
tar xzf meteor.tar.gz
mv bundle/* ./
rm -f bundle/.node_version.txt
rm -r bundle/
rm meteor.tar.gz
}
# Setup
echo -e "\e[0m\e[1mCreating directories ...\e[90m"
mkdir -p ${TMP_DIR}/BJS
mkdir -p ${TARGET}/docs/user
mkdir -p ${TARGET}/docs/developer
cd meteor
# API docs
echo -e "\e[0m\e[1mBuilding developer documentation ...\e[90m"
./generate_documentation.sh > /dev/null
echo -e "\e[0m\e[1mCopying developer documentation ...\e[90m"
cp -r ../docs/* ${TARGET}/docs/developer
# User docs
# echo -e "\e[0m\e[1mDownloading user documentation ...\e[90m"
# curl "https://docs.google.com/document/export?format=pdf&id=${USER_DOC_ID}" > ${TARGET}/docs/user/BJS.pdf
cp ../userDoc/UserManual.pdf ${TARGET}/docs/user/BJS.pdf
# Meteor build
for arch in "${ARCHS[@]}"; do
echo -e "\e[0m\e[1mBuilding ${arch} ...\e[90m"
meteorBuild ${arch}
done
# Decompression
echo -e "\e[0m\e[1mDecompressing bundles ...\e[90m"
for arch in "${ARCHS[@]}"; do
cd ${TARGET}/${arch} && decompress
done
# Copy over run scripts
for arch in "${ARCHS[@]}"; do
cp ${ORIGIN}/runScripts/* ${TARGET}/${arch}/
done
# Compress files
echo -e "\e[0m\e[1mCreating archive ...\e[90m"
cd ${TMP_DIR}
zip -r ${ORIGIN}/BJS.zip ./BJS -q -9 -o
cd ${ORIGIN}
echo -e "\e[0m\e[1mDone!"