From 7552a725778a35462e9fa30640aa8e95abc4c2be Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 27 Aug 2013 16:05:48 +0800 Subject: [PATCH] issue #2732: [iOS] Updating the reference of auto-generated binding glue codes. --- .../project.pbxproj.REMOVED.git-id | 2 +- .../HelloAnalytics-JS/Classes/AppDelegate.cpp | 4 +- .../HelloIAP-JS/Classes/AppDelegate.cpp | 4 +- .../AssetsManagerTest/Classes/AppDelegate.cpp | 2 +- .../CocosDragonJS/Classes/AppDelegate.cpp | 4 +- .../CrystalCraze/Classes/AppDelegate.cpp | 4 +- .../MoonWarriors/Classes/AppDelegate.cpp | 4 +- .../TestJavascript/Classes/AppDelegate.cpp | 4 +- .../WatermelonWithMe/Classes/AppDelegate.cpp | 4 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../cocos2d_specifics.cpp.REMOVED.git-id | 2 +- .../multi-platform-js/Classes/AppDelegate.cpp | 4 +- tools/travis-scripts/generate-jsbindings.sh | 38 ++++++++++++------- 13 files changed, 44 insertions(+), 34 deletions(-) diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 116f89b47f..89ce949321 100644 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -027d1d69c91552623e04c46fd002c5976c4bb40c \ No newline at end of file +9bf893fd31bf044ec732332fb109c050b711fdc8 \ No newline at end of file diff --git a/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp b/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp index 2e5330a1b8..f11764c513 100644 --- a/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp +++ b/plugin/samples/HelloAnalytics-JS/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" #include "js_bindings_system_registration.h" diff --git a/plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp b/plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp index f3005181cb..d2b993e889 100644 --- a/plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp +++ b/plugin/samples/HelloIAP-JS/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" #include "js_bindings_system_registration.h" diff --git a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp index 3e222e6bf6..6d34e0ef82 100644 --- a/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp +++ b/samples/Cpp/AssetsManagerTest/Classes/AppDelegate.cpp @@ -8,7 +8,7 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" #include "cocos2d_specifics.hpp" #if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) diff --git a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp index 670d57a92b..da5a5d6dc7 100644 --- a/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp +++ b/samples/Javascript/CocosDragonJS/Classes/AppDelegate.cpp @@ -6,8 +6,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_ccbreader.h" diff --git a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp index ec958730ba..246f022d4c 100644 --- a/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp +++ b/samples/Javascript/CrystalCraze/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_ccbreader.h" diff --git a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp index 0932e12b27..93dc35d856 100644 --- a/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp +++ b/samples/Javascript/MoonWarriors/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_ccbreader.h" diff --git a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp index 69d9cb6b60..4b7b6c87ff 100644 --- a/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/Javascript/TestJavascript/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" diff --git a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp index 3364e34c12..c0878b49e0 100644 --- a/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp +++ b/samples/Javascript/WatermelonWithMe/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" diff --git a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id index e3b14635f1..1e5160fb00 100644 --- a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -10b7b9eb9dd50e4480e377538b5a1fa7261b9029 \ No newline at end of file +01ccea588d07b1419922fb6fd66502422184c2bd \ No newline at end of file diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id index dbf188c465..a1179d6b16 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp.REMOVED.git-id @@ -1 +1 @@ -d4944c285d6219a01aa06f326168ae67d08b9cb0 \ No newline at end of file +1a67569d3ade0153cccbfa71ca5ac5355d03fbd4 \ No newline at end of file diff --git a/template/multi-platform-js/Classes/AppDelegate.cpp b/template/multi-platform-js/Classes/AppDelegate.cpp index f086f7b889..ec78d9f5ae 100644 --- a/template/multi-platform-js/Classes/AppDelegate.cpp +++ b/template/multi-platform-js/Classes/AppDelegate.cpp @@ -3,8 +3,8 @@ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "ScriptingCore.h" -#include "generated/jsb_cocos2dx_auto.hpp" -#include "generated/jsb_cocos2dx_extension_auto.hpp" +#include "jsb_cocos2dx_auto.hpp" +#include "jsb_cocos2dx_extension_auto.hpp" #include "jsb_cocos2dx_extension_manual.h" #include "cocos2d_specifics.hpp" #include "js_bindings_chipmunk_registration.h" diff --git a/tools/travis-scripts/generate-jsbindings.sh b/tools/travis-scripts/generate-jsbindings.sh index ffc59702fe..2a1dd3b69a 100755 --- a/tools/travis-scripts/generate-jsbindings.sh +++ b/tools/travis-scripts/generate-jsbindings.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Generate JS bindings for Cocos2D-X +# Generate JS and Lua bindings for Cocos2D-X # ... using Android NDK system headers # ... and automatically update submodule references # ... and push these changes to remote repos @@ -8,7 +8,7 @@ # Dependencies # # For bindings generator: -# (see ../../../tojs/genbindings.sh +# (see ../../../tojs/genbindings.sh and ../../../tolua/genbindings.sh # ... for the defaults used if the environment is not customized) # # * $PYTHON_BIN @@ -19,7 +19,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR"/../.. TOJS_ROOT=$COCOS2DX_ROOT/tools/tojs -GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/javascript/bindings/generated +TOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua +GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/auto-generated COMMITTAG="[AUTO]" # Exit on error @@ -42,10 +43,21 @@ else sudo apt-get --force-yes --yes install python-yaml python-cheetah fi -if [ "$GEN_JSB"x != "YES"x ]; then +generate_bindings_glue_codes() +{ + echo "Create auto-generated jsbinding glue codes." pushd "$TOJS_ROOT" ./genbindings.sh popd + + echo "Create auto-generated luabinding glue codes." + pushd "$TOLUA_ROOT" + ./genbindings.sh + popd +} + +if [ "$GEN_JSB"x != "YES"x ]; then + generate_bindings_glue_codes exit 0 fi @@ -55,11 +67,11 @@ git config user.email ${GH_EMAIL} git config user.name ${GH_USER} popd -# Update submodule of auto-gen JSBinding repo. +# Update submodule of auto-gen Binding repo. pushd "$GENERATED_WORKTREE" git checkout -B master -#Set git user for the submodule of 'scripting/javascript/bindings/generated' +echo "Set git user for the submodule of ${GENERATED_WORKTREE}" git config user.email ${GH_EMAIL} git config user.name ${GH_USER} #Set remotes @@ -67,16 +79,14 @@ git remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/folecr/coco echo "Delete all directories and files except '.git' and 'README'." ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README$ | xargs -I{} rm -rf {} -echo "Show files in scripting/javascript/bindings/generated folder." +echo "Show files in ${GENERATED_WORKTREE} folder." ls -a popd # 1. Generate JS bindings -pushd "$TOJS_ROOT" -./genbindings.sh -popd +generate_bindings_glue_codes echo echo Bindings generated successfully @@ -98,7 +108,7 @@ echo Using "$ELAPSEDSECS" in the branch names for pseudo-uniqueness GENERATED_BRANCH=autogeneratedbindings_"$ELAPSEDSECS" -# 2. In JSBindings repo, Check if there are any files that are different from the index +# 2. In Bindings repo, Check if there are any files that are different from the index pushd "$GENERATED_WORKTREE" @@ -130,13 +140,13 @@ fi # Exit on error set -e -# 3. In JSBindings repo, Check out a branch named "autogeneratedbindings" and commit the auto generated bindings to it +# 3. In Bindings repo, Check out a branch named "autogeneratedbindings" and commit the auto generated bindings to it git checkout -b "$GENERATED_BRANCH" git add --verbose . git add --verbose -u . git commit --verbose -m "$COMMITTAG : autogenerated bindings" -# 4. In JSBindings repo, Push the commit with generated bindings to "master" of the auto generated bindings repository +# 4. In Bindings repo, Push the commit with generated bindings to "master" of the auto generated bindings repository git push -fq upstream "$GENERATED_BRANCH":${TRAVIS_BRANCH}_${ELAPSEDSECS} 2> /dev/null popd @@ -148,7 +158,7 @@ pushd "${DIR}" # 5. In Cocos2D-X repo, Checkout a branch named "updategeneratedsubmodule" Update the submodule reference to point to the commit with generated bindings cd "${COCOS2DX_ROOT}" -git add scripting/javascript/bindings/generated +git add ${GENERATED_WORKTREE} git checkout -b "$COCOS_BRANCH" git commit -m "$COMMITTAG : updating submodule reference to latest autogenerated bindings" #Set remotes