glueIt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. #set -o xtrace
  3. case "$1" in
  4. "clean")
  5. echo "removing ./build dir..."
  6. rm -R ./build
  7. ;;
  8. "build")
  9. echo "building SuperGlue clients..."
  10. mkdir -p ./build
  11. mkdir -p ./build/firefox
  12. mkdir -p ./build/chromium
  13. cp -R ./src/firefox/* ./build/firefox
  14. cp -R ./src/chromium/* ./build/chromium
  15. mkdir -p ./build/firefox/data/superglue-client
  16. mkdir -p ./build/chromium/superglue-client
  17. cp -R ./src/allplatforms/* ./build/firefox/data/superglue-client
  18. cp -R ./src/allplatforms/* ./build/chromium/superglue-client
  19. ;;
  20. "testFF")
  21. echo "Testing Firefox add-on..."
  22. cd ./tools/firefox-addon-sdk-1.16
  23. . ./bin/activate
  24. cd ../../build/firefox
  25. cfx run
  26. cd ../..
  27. ;;
  28. "pkgFF")
  29. echo "Packaging Firefox add-on..."
  30. cd ./tools/firefox-addon-sdk-1.16
  31. . ./bin/activate
  32. cd ../../build/firefox
  33. cfx xpi
  34. mv *.xpi ../superglue-firefox.xpi
  35. cd ../..
  36. ;;
  37. "pkgCH")
  38. test -x $(which xvfb-run || echo 'false') && test -x $(which chromium || echo 'false') &&
  39. echo "Packaging Chromium extension..." &&
  40. (xvfb-run --server-args='-screen 0, 1024x768x16' chromium --pack-extension=./build/chromium >/dev/null &&
  41. cd ./build; for i in chromium.*; do mv $i superglue-$i; done; cd .. ||
  42. echo 'run "./glueIt clean" before building') ||
  43. echo "'chromium' and 'xvfb' must be installed"
  44. ;;
  45. *)
  46. echo "Usage: $0"
  47. echo " "
  48. echo " clean Remove build dir"
  49. echo " build Build SuperGlue clients"
  50. echo " "
  51. echo " testFF Test Firefox add-on in sandboxed browser"
  52. echo " pkgFF Make Firefox add-on package (./build/superglue.xpi)"
  53. echo " pkgCH Make Chromium extension package (./build/superglue.crx)"
  54. # echo " (---- To package Chromium extension, go there to chrome://extensions)"
  55. echo " "
  56. echo "ATTENTION!! Call $0 only in root of the project directory!"
  57. echo " "
  58. ;;
  59. esac