Skip to content

Commit

Permalink
Adding travis-ci build for emscripten port.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen committed Jun 10, 2013
1 parent 6f01085 commit 15f5538
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ env:
- PLATFORM=linux DEBUG=1
- PLATFORM=nacl DEBUG=1
- PLATFORM=android
- PLATFORM=emscripten DEBUG=1
global:
- secure: |-
cHXOjAda+t2tmBVuVAiQfvhDN+unToO6hX1rc3dJeGDOk4rlQnylJacjA7o/
Expand Down
20 changes: 20 additions & 0 deletions tools/travis-scripts/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ install_llvm()
mv clang+llvm-3.1-x86_64-${HOST_NAME} clang+llvm-3.1
}

install_llvm_3_2()
{
if [ "$PLATFORM"x = "ios"x ]; then
HOST_NAME="apple-darwin11"
else
HOST_NAME="linux-ubuntu-12.04"
fi
# Download llvm3.2
echo "Download clang+llvm-3.2-x86_64-${HOST_NAME}.tar.gz"
curl -O http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-${HOST_NAME}.tar.gz
echo "Decompress clang+llvm-3.2-x86_64-${HOST_NAME}.tar.gz ..."
tar xzf clang+llvm-3.2-x86_64-${HOST_NAME}.tar.gz
# Rename llvm
mv clang+llvm-3.2-x86_64-${HOST_NAME} clang+llvm-3.2
}

if [ "$GEN_JSB"x = "YES"x ]; then
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
exit 0
Expand Down Expand Up @@ -69,6 +85,10 @@ if [ "$PLATFORM"x = "android"x ]; then
install_llvm
fi

if [ "$PLATFORM"x = "emscripten"x ]; then
install_llvm_3_2
fi

if [ "$PLATFORM"x = "ios"x ]; then
install_android_ndk
install_llvm
Expand Down
9 changes: 9 additions & 0 deletions tools/travis-scripts/run-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ if [ "$PLATFORM"x = "linux"x ]; then
make -j4
fi

if [ "$PLATFORM"x = "emscripten"x ]; then
cd $COCOS2DX_ROOT
export PYTHON=/usr/bin/python
export LLVM=$HOME/bin/clang+llvm-3.2/bin
sudo mkdir -p /Library/Fonts
sudo cp samples/Cpp/TestCpp/Resources/fonts/arial.ttf /Library/Fonts/Arial.ttf
make -f Makefile.emscripten -j 8
fi

if [ "$PLATFORM"x = "ios"x ]; then
cd $COCOS2DX_ROOT/tools/travis-scripts
./generate-jsbindings.sh
Expand Down

0 comments on commit 15f5538

Please sign in to comment.