From 1d932ae95f5a04df83895934ed63f40dd8016f0d Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 1 Nov 2013 11:46:02 +0800 Subject: [PATCH 1/2] Updating travic-ci scripts. --- tools/travis-scripts/before-install.sh | 4 +-- tools/travis-scripts/generate-jsbindings.sh | 8 ++--- tools/travis-scripts/run-script.sh | 39 ++++++--------------- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/tools/travis-scripts/before-install.sh b/tools/travis-scripts/before-install.sh index 4353b026a8..93cdb195fe 100755 --- a/tools/travis-scripts/before-install.sh +++ b/tools/travis-scripts/before-install.sh @@ -102,8 +102,8 @@ elif [ "$PLATFORM"x = "linux"x ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 90 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7 g++ --version - bash $COCOS2DX_ROOT/install-deps-linux.sh - bash $DIR/install_glfw.sh + bash $COCOS2DX_ROOT/build/install-deps-linux.sh + bash $COCOS2DX_ROOT/build/install_glfw.sh install_android_ndk install_llvm elif [ "$PLATFORM"x = "nacl"x ]; then diff --git a/tools/travis-scripts/generate-jsbindings.sh b/tools/travis-scripts/generate-jsbindings.sh index 2a1dd3b69a..dcb2b9bd0f 100755 --- a/tools/travis-scripts/generate-jsbindings.sh +++ b/tools/travis-scripts/generate-jsbindings.sh @@ -20,7 +20,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR"/../.. TOJS_ROOT=$COCOS2DX_ROOT/tools/tojs TOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua -GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/auto-generated +GENERATED_WORKTREE="$COCOS2DX_ROOT"/cocos/scripting/auto-generated COMMITTAG="[AUTO]" # Exit on error @@ -75,10 +75,10 @@ echo "Set git user for the submodule of ${GENERATED_WORKTREE}" git config user.email ${GH_EMAIL} git config user.name ${GH_USER} #Set remotes -git remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/folecr/cocos2dx-autogen-bindings.git 2> /dev/null > /dev/null +git remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/cocos2d-x/bindings-auto-generated.git 2> /dev/null > /dev/null -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 "Delete all directories and files except '.git' and 'README.md'." +ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README.md$ | xargs -I{} rm -rf {} echo "Show files in ${GENERATED_WORKTREE} folder." ls -a popd diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index 79c063dc0e..7e86b00319 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -5,15 +5,6 @@ set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" COCOS2DX_ROOT="$DIR"/../.. -build_android() -{ - echo "Current dir: `pwd`" - pushd $1/proj.android - ln -s $COCOS2DX_ROOT/android_build_objs obj - ./build_native.sh - popd -} - if [ "$GEN_JSB"x = "YES"x ]; then # Re-generation of the javascript bindings can perform push of the new # version back to github. We don't do this for pull requests, or if @@ -51,23 +42,15 @@ elif [ "$PLATFORM"x = "android"x ]; then # Create a directory for temporary objects mkdir android_build_objs - # Build samples - echo "Building samples ..." - cd $COCOS2DX_ROOT/samples/Cpp - build_android HelloCpp - build_android TestCpp - build_android AssetsManagerTest + PROJECTS=("Cpp/HelloCpp" "Cpp/TestCpp" "Cpp/AssetsManagerTest" "Javascript/TestJavascript" "Javascript/CocosDragonJS" "Javascript/CrystalCraze" "Javascript/MoonWarriors" "Javascript/WatermelonWithMe" "Lua/HelloLua" "Lua/TestLua") + for i in ${PROJECTS[*]}; do + ln -s $COCOS2DX_ROOT/android_build_objs $COCOS2DX_ROOT/samples/$i/proj.android/obj + done - cd $COCOS2DX_ROOT/samples/Javascript - build_android TestJavascript - build_android CocosDragonJS - build_android CrystalCraze - build_android MoonWarriors - build_android WatermelonWithMe - - cd $COCOS2DX_ROOT/samples/Lua - build_android HelloLua - build_android TestLua + # Build all samples + echo "Building all samples ..." + cd $COCOS2DX_ROOT/build + ./android-build.py all # Build template # echo "Building template ..." @@ -80,7 +63,7 @@ elif [ "$PLATFORM"x = "nacl"x ]; then export NACL_SDK_ROOT=$HOME/bin/nacl_sdk/pepper_canary export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_arm_newlib/bin - cd $COCOS2DX_ROOT + cd $COCOS2DX_ROOT/build make -j4 elif [ "$PLATFORM"x = "linux"x ]; then # Generate binding glue codes @@ -88,7 +71,7 @@ elif [ "$PLATFORM"x = "linux"x ]; then cd $COCOS2DX_ROOT/tools/travis-scripts ./generate-jsbindings.sh - cd $COCOS2DX_ROOT + cd $COCOS2DX_ROOT/build make -j4 elif [ "$PLATFORM"x = "emscripten"x ]; then # Generate binding glue codes @@ -96,7 +79,7 @@ elif [ "$PLATFORM"x = "emscripten"x ]; then cd $COCOS2DX_ROOT/tools/travis-scripts ./generate-jsbindings.sh - cd $COCOS2DX_ROOT + cd $COCOS2DX_ROOT/build export PYTHON=/usr/bin/python export LLVM=$HOME/bin/clang+llvm-3.2/bin export LLVM_ROOT=$LLVM From 72d6f8650b3d06ae67332cdfb6f933ec54c50978 Mon Sep 17 00:00:00 2001 From: James Chen Date: Fri, 1 Nov 2013 11:50:43 +0800 Subject: [PATCH 2/2] Regular expression fix for generate-jsbindings.sh. --- tools/travis-scripts/generate-jsbindings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis-scripts/generate-jsbindings.sh b/tools/travis-scripts/generate-jsbindings.sh index dcb2b9bd0f..cd7f897e20 100755 --- a/tools/travis-scripts/generate-jsbindings.sh +++ b/tools/travis-scripts/generate-jsbindings.sh @@ -78,7 +78,7 @@ git config user.name ${GH_USER} git remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/cocos2d-x/bindings-auto-generated.git 2> /dev/null > /dev/null echo "Delete all directories and files except '.git' and 'README.md'." -ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README.md$ | xargs -I{} rm -rf {} +ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README\.md$ | xargs -I{} rm -rf {} echo "Show files in ${GENERATED_WORKTREE} folder." ls -a popd