#!/bin/sh #set -o xtrace case "$1" in "clean") echo "removing ./build dir..." rm -R ./build ;; "build") echo "building SuperGlue clients..." mkdir -p ./build mkdir -p ./build/firefox mkdir -p ./build/chromium cp -R ./src/firefox/* ./build/firefox cp -R ./src/chromium/* ./build/chromium mkdir -p ./build/firefox/data/superglue-client mkdir -p ./build/chromium/superglue-client cp -R ./src/allplatforms/* ./build/firefox/data/superglue-client cp -R ./src/allplatforms/* ./build/chromium/superglue-client ;; "testFF") echo "Testing Firefox add-on..." cd ./tools/firefox-addon-sdk-1.16 . ./bin/activate cd ../../build/firefox cfx run cd ../.. ;; "pkgFF") echo "Packaging Firefox add-on..." cd ./tools/firefox-addon-sdk-1.16 . ./bin/activate cd ../../build/firefox cfx xpi mv *.xpi ../ cd ../.. ;; "pkgCH") test -x $(which xvfb-run || echo 'false') && test -x $(which chromium || echo 'false') && echo "Packaging Chromium extension..." && (xvfb-run --server-args='-screen 0, 1024x768x16' chromium --pack-extension=./build/chromium >/dev/null || echo 'run "./glueIt clean" before building') || echo "'chromium' and 'xvfb-run' executables must be available" ;; *) echo "Usage: $0" echo " " echo " clean Remove build dir" echo " build Build SuperGlue clients" echo " " echo " testFF Test Firefox add-on in sandboxed browser" echo " pkgFF Make Firefox add-on package (./build/superglue.xpi)" echo " pkgCH Make Chromium extension package (./build/superglue.crx)" # echo " (---- To package Chromium extension, go there to chrome://extensions)" echo " " echo "ATTENTION!! Call $0 only in root of the project directory!" echo " " ;; esac