2013-04-07 16:58:26 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-04-27 11:32:12 +08:00
|
|
|
PLUGIN_NAME=("alipay" "flurry" "nd91" "umeng" "admob" "twitter")
|
2013-04-07 16:58:26 +08:00
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
# ... use paths relative to current directory
|
|
|
|
PLUGIN_ROOT="$DIR/../.."
|
2013-04-09 13:41:24 +08:00
|
|
|
CXX_GENERATOR_ROOT="$DIR/../../../tools/bindings-generator"
|
2013-04-07 16:58:26 +08:00
|
|
|
# Delete the output directory
|
|
|
|
if [ -d $PLUGIN_ROOT/jsbindings/auto ]; then
|
|
|
|
echo "Delete the output directory."
|
|
|
|
rm -r $PLUGIN_ROOT/jsbindings/auto
|
|
|
|
else
|
|
|
|
echo "Output directory doesn't exist."
|
|
|
|
fi
|
|
|
|
|
|
|
|
check_return_value()
|
|
|
|
{
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "*** genbindings plugin ( $1 ) jsbindings fails. ***"
|
|
|
|
if [ -e $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup ]; then
|
|
|
|
echo "Restoring conversions.yaml ..."
|
|
|
|
mv $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml.backup $CXX_GENERATOR_ROOT/targets/spidermonkey/conversions.yaml
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "--- genbindings plugin ( $1 ) jsbindings succeed. ---"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
./genbindings.sh "protocols"
|
|
|
|
check_return_value "protocols"
|
|
|
|
|
|
|
|
for i in "${PLUGIN_NAME[@]}"
|
|
|
|
do
|
|
|
|
echo $i
|
2013-04-08 10:54:51 +08:00
|
|
|
./genbindings.sh $i "plugins/"
|
2013-04-07 16:58:26 +08:00
|
|
|
check_return_value $i
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "--- Generating all jsbindings glue codes for pluginx succeed. :) --- "
|