-
Notifications
You must be signed in to change notification settings - Fork 2
/
dev_build_web.sh
45 lines (35 loc) · 2 KB
/
dev_build_web.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
#!/bin/bash
# Download bob.jar like that:
# wget "https://github.com/defold/defold/releases/download/1.6.2/bob.jar" -O bob.jar
# Plus, the script uses https://www.npmjs.com/package/http-server to serve local files.
set -e
PLATFORM=wasm-web
mkdir -p public
# BUNDLE 1
BUNDLE_DIR=bundle-1
RESZIP_INI="reszip.ini"
RESOURCES_ZIP="resources_$(date +%s).zip"
echo -e "[liveupdate_reszip]\nfilename = ${RESOURCES_ZIP}\npreload_file = ${RESOURCES_ZIP}\n\n" > "${RESZIP_INI}"
sed -i 's/"enabled", true/"enabled", false/' example/level2/set_alt_text.script
rm -rf build
mkdir -p build/bundle
java -jar bob.jar --email f@b.com --auth 123 --texture-compression true --settings "${RESZIP_INI}" --bundle-output build/bundle/${PLATFORM} --build-report-html "build/bundle/build_report_${BUNDLE_DIR}.html" --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle
mv build/liveupdate_output/*.zip "build/bundle/${PLATFORM}/liveupdate_reszip_demo/${RESOURCES_ZIP}"
rm -f "${RESZIP_INI}"
mv build/bundle/*.html "public/"
mv "build/bundle/${PLATFORM}/liveupdate_reszip_demo" "public/${BUNDLE_DIR}"
# BUNDLE 2
BUNDLE_DIR=bundle-2
RESZIP_INI="reszip.ini"
RESOURCES_ZIP="resources_$(date +%s).zip"
echo -e "[liveupdate_reszip]\nfilename = ${RESOURCES_ZIP}\npreload_file = ${RESOURCES_ZIP}\n\n" > "${RESZIP_INI}"
sed -i 's/"enabled", false/"enabled", true/' example/level2/set_alt_text.script
rm -rf build
mkdir -p build/bundle
java -jar bob.jar --email f@b.com --auth 123 --texture-compression true --settings "${RESZIP_INI}" --bundle-output build/bundle/${PLATFORM} --build-report-html "build/bundle/build_report_${BUNDLE_DIR}.html" --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle
mv build/liveupdate_output/*.zip "build/bundle/${PLATFORM}/liveupdate_reszip_demo/${RESOURCES_ZIP}"
rm -f "${RESZIP_INI}"
mv build/bundle/*.html "public/"
mv "build/bundle/${PLATFORM}/liveupdate_reszip_demo" "public/${BUNDLE_DIR}"
# DONE
# http-server -c-