Current version. Texture compression wasn’t enabled before!
#!/bin/bash
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//')
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]')
echo "Project: ${title}"
if [ ! -f bob.jar ]
then
echo "Unable to find bob.jar. Download it from d.defold.com."
exit 1
fi
bob() {
java -jar bob.jar $@
}
bundle() {
platform=$1
echo "${platform}"
shift 1
bob --platform ${platform} --bundle-output build/${platform} $@ bundle
}
archive() {
platform=$1
if [ "${platform}" == "armv7-android" ]
then
echo "${title_no_space}.apk"
mv "build/${platform}/${title}/${title}.apk" "${title_no_space}.apk"
elif [ "${platform}" == "armv7-darwin" ]
then
echo "${title_no_space}.ipa"
mv "build/${platform}/${title}/${title}.ipa" "${title_no_space}.ipa"
elif [ "${platform}" == "x86_64-darwin" ]
then
echo "${title_no_space}_${platform}.zip"
rm -rf "${title_no_space}_${platform}.zip"
cd build/${platform}
zip -r -q "../../${title_no_space}_${platform}.zip" *
cd ../..
else
echo "${title_no_space}_${platform}.zip"
rm -rf "${title_no_space}_${platform}.zip"
cd "build/${platform}/${title}"
zip -r -q "../../../${title_no_space}_${platform}.zip" *
cd ../../..
fi
}
# build
echo -e "\n[Building]"
rm -rf build
bob --archive build --build-report-html build-report.html --texture-compression true --variant "release"
# bundle platforms
echo -e "\n[Bundling]"
bundle x86_64-win32
bundle x86_64-darwin
bundle x86_64-linux
# archive bundled platforms
echo -e "\n[Archiving]"
archive x86_64-win32
archive x86_64-darwin
archive x86_64-linux
ffplay fanfare.mp3 -autoexit -nodisp
The final line plays the final fantasy victory fanfare once everything is complete.
If anyone else has made a production script like this please share it!
Actually I’m just now testing running the produced exe and it seems like it’s still not working right. Game runs and gets past our splash screens but then is stuck on loading collections… it could be a bug in our project (I think last night it was working…) so I’ll try debug / bundle from editor…
When opening build report.html I get this error
DataTables warning: table id=resources-list - Requested unknown parameter {function} for row 137, column 5. For more information about this error, please see http://datatables.net/tn/4
Version bundled from editor still works right so must be something missing or wrong in this script. Help?