Skip to content

Instantly share code, notes, and snippets.

@fitzgen
Created March 13, 2013 20:50
Show Gist options
  • Save fitzgen/5156022 to your computer and use it in GitHub Desktop.
Save fitzgen/5156022 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
function errorAndExit {
echo "Error building, see '.build-error.log' file"
say "Error! Error! Error!"
exit 1
}
if [ -e "`pwd`/.git" ]; then
OBJ="obj-`git rev-parse --abbrev-ref HEAD`"
else
OBJ="obj"
fi
if [[ -d $OBJ ]]; then
make -C $OBJ/browser/devtools &> .build-error.log || errorAndExit
make -C $OBJ/toolkit/devtools &> .build-error.log || errorAndExit
make -C $OBJ/browser/app &> .build-error.log || errorAndExit
else
./mach build &> .build-error.log || errorAndExit
# Only say things if this is going to be a long build, we might be alt
# tabbed.
say "Successfully finished building."
fi
# Since we got this far without exiting, there weren't any errors and we can
# delete the log.
rm .build-error.log
echo
echo "# To Run:"
echo "./$OBJ/dist/Nightly.app/Contents/MacOS/firefox-bin -P Nightly"
echo "# XPC shell tests:"
echo "./mach xpcshell-test toolkit/devtools/debugger/tests/unit"
echo "# Mochitests:"
echo "make TEST_PATH=browser/devtools/debugger/test/ -C $OBJ mochitest-browser-chrome | grep -v SCREENSHOT | grep -v 'JavaScript Warning'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment