genbindings-all.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  3. # ... use paths relative to current directory
  4. PLUGIN_ROOT="$DIR/../.."
  5. CXX_GENERATOR_ROOT="$DIR/../../../tools/bindings-generator"
  6. # Delete the output directory
  7. if [ -d $PLUGIN_ROOT/jsbindings/auto ]; then
  8. echo "Delete the output directory."
  9. rm -r $PLUGIN_ROOT/jsbindings/auto
  10. else
  11. echo "Output directory doesn't exist."
  12. fi
  13. check_return_value()
  14. {
  15. if [ $? -ne 0 ]; then
  16. echo "*** genbindings plugin ( $1 ) jsbindings fails. ***"
  17. if [ -e $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup ]; then
  18. echo "Restoring conversions.yaml ..."
  19. mv $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml
  20. fi
  21. exit 1
  22. else
  23. echo "--- genbindings plugin ( $1 ) jsbindings succeed. ---"
  24. fi
  25. }
  26. ./genbindings.sh "cocos2dx_pluginx" $PLUGIN_ROOT $CXX_GENERATOR_ROOT
  27. check_return_value "cocos2dx_pluginx"
  28. echo "--- Generating all jsbindings glue codes for pluginx succeed. :) --- "