Skip to content

Commit

Permalink
Updates travis script to add mac host support
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen committed May 12, 2014
1 parent 36c4a40 commit 91d684d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ env:
matrix:
- GEN_BINDING=YES
- GEN_COCOS_FILES=YES
- PLATFORM=mac-ios PUSH_TO_MAC=YES
- PLATFORM=linux DEBUG=1 CC_COMPILER=gcc CXX_COMPILER=g++
- PLATFORM=linux DEBUG=1 CC_COMPILER=clang CXX_COMPILER=clang++
# Since switching to C++11 only the ARM version of the nactive client
Expand All @@ -24,6 +25,7 @@ env:
Wsngwo3jlZtvuPfr3RNhqrz/liNIhKYnlw4KYJO90gMQ9ZQKRTlMv2BMiPw/
9lV+vgJQDRcFe7dKwtC86vk10EU7Ym2bhVmhMxi/AlmJXgavjmPVdizRT7rh
X2Ry/Nb6hGRkH3WS0T3D/KG1+e7lP/TMB9bvo6/locLJ2A6Z1YI=
- secure: PGMnEvysYv9Mnjrof05v9MU41ZlVO7A7SQb4oLuYqhBf0stvZUVEF4fmkOcXRPAd4Cg41aAbtE8RyGaqIFaKHtjHFtTdisM9XVXqL+eMfv5L+8nFCk4S5Fi/ohglO+FBJ9X/NLfAfRZmlwJR+UedU5AJwqlQbKraNkyv/FmDMUc=
script:
- export CC=$CC_COMPILER
- export CXX=$CXX_COMPILER
Expand Down
26 changes: 17 additions & 9 deletions tools/travis-scripts/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd $HOME/bin
install_android_ndk()
{
# Download android ndk
if [ "$PLATFORM"x = "ios"x ]; then
if [ "$PLATFORM"x = "mac-ios"x ]; then
HOST_NAME="darwin"
else
HOST_NAME="linux"
Expand Down Expand Up @@ -71,14 +71,22 @@ elif [ "$PLATFORM"x = "emscripten"x ]; then
sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm

install_android_ndk
elif [ "$PLATFORM"x = "ios"x ]; then
install_android_ndk

pushd $COCOS2DX_ROOT
git submodule add https://github.com/facebook/xctool.git ./xctool
git submodule init
git submodule update
popd
elif [ "$PLATFORM"x = "mac-ios"x ]; then
if [ "$PUSH_TO_MAC"x = "YES"x ]; then
cd $COCOS2DX_ROOT
git config user.email ${GH_EMAIL_MAC}
git config user.name ${GH_USER_MAC}
git checkout -B $TRAVIS_BRANCH
cp tools/travis-scripts/travis_mac.yml ./.travis.yml
git add .travis.yml
cat .travis.yml
git commit --amend -m "`git log -1 --pretty=%B`"
git remote add travis-mac https://$GH_USER_MAC:$GH_PASSWORD_MAC@github.com/cocos-travis-mac/cocos2d-x.git
git push -f travis-mac $TRAVIS_BRANCH 2> /dev/null > /dev/null
else
echo "xctool version: `xctool --version`"
install_android_ndk
fi
else
echo "Unknown \$PLATFORM: '$PLATFORM'"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions tools/travis-scripts/generate-bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COMMIT_PATH="cocos/scripting/lua-bindings/auto"
# Exit on error
set -e

if [ "$PLATFORM"x = "ios"x ]; then
if [ "$PLATFORM"x = "mac-ios"x ]; then
mkdir -p $HOME/bin
pushd $HOME/bin
curl -O http://pyyaml.org/download/pyyaml/PyYAML-3.10.zip
Expand Down Expand Up @@ -126,7 +126,7 @@ git remote add upstream "$COCOS_ROBOT_REMOTE" 2> /dev/null > /dev/null
echo "Pushing to Robot's repo ..."
git push -fq upstream "$COCOS_BRANCH" 2> /dev/null

# 7.
# 7.
echo "Sending Pull Request to base repo ..."
curl --user "${GH_USER}:${GH_PASSWORD}" --request POST --data "{ \"title\": \"$COMMITTAG\", \"body\": \"\", \"head\": \"${GH_USER}:${COCOS_BRANCH}\", \"base\": \"${TRAVIS_BRANCH}\"}" "${PULL_REQUEST_REPO}" 2> /dev/null > /dev/null

Expand Down
26 changes: 9 additions & 17 deletions tools/travis-scripts/run-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,15 @@ elif [ "$PLATFORM"x = "emscripten"x ]; then
export LLVM=$HOME/bin/clang+llvm-3.2/bin
export LLVM_ROOT=$LLVM
EMCC_DEBUG=1 make PLATFORM=emscripten -j 8
elif [ "$PLATFORM"x = "ios"x ]; then
cd $COCOS2DX_ROOT/tools/travis-scripts
./generate-bindings.sh
./generate-cocosfiles.sh

cd $COCOS2DX_ROOT
xctool/xctool.sh -project samples/Cpp/HelloCpp/proj.ios/HelloCpp.xcodeproj -scheme HelloCpp test
xctool/xctool.sh -project samples/Cpp/SimpleGame/proj.ios/SimpleGame.xcodeproj -scheme SimpleGame test
xctool/xctool.sh -project samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj -scheme TestCpp test
#xctool/xctool.sh -project samples/Cpp/AssetsManagerTest/proj.ios/AssetsManagerTest.xcodeproj -scheme AssetsManagerTest test
#xctool/xctool.sh -project samples/Javascript/CocosDragonJS/proj.ios/CocosDragonJS.xcodeproj -scheme CocosDragonJS test
#xctool/xctool.sh -project samples/Javascript/CrystalCraze/proj.ios/CrystalCraze.xcodeproj -scheme CrystalCraze test
xctool/xctool.sh -project samples/Javascript/MoonWarriors/proj.ios/MoonWarriors.xcodeproj -scheme MoonWarriors test
xctool/xctool.sh -project samples/Javascript/TestJavascript/proj.ios/TestJavascript.xcodeproj -scheme TestJavascript test
#xctool/xctool.sh -project samples/Javascript/WatermelonWithMe/proj.ios/WatermelonWithMe.xcodeproj -scheme WatermelonWithMe test
xctool/xctool.sh -project samples/Lua/HelloLua/proj.ios/HelloLua.xcodeproj -scheme HelloLua test
xctool/xctool.sh -project samples/Lua/TestLua/proj.ios/TestLua.xcodeproj -scheme TestLua test
elif [ "$PLATFORM"x = "mac-ios"x ]; then
if [ "$PUSH_TO_MAC"x != "YES"x ]; then
cd $COCOS2DX_ROOT/tools/travis-scripts
./generate-bindings.sh
./generate-cocosfiles.sh

cd $COCOS2DX_ROOT
xctool -project build/cocos2d_tests.xcodeproj -scheme "$SCHEME" -jobs 8 -arch "$ARCH" -sdk "$SDK" build
fi
else
echo "Unknown \$PLATFORM: '$PLATFORM'"
exit 1
Expand Down

0 comments on commit 91d684d

Please sign in to comment.