mirror of https://github.com/axmolengine/axmol.git
Optimize ci scripts [skip ci]
This commit is contained in:
parent
a02cfaf5a8
commit
490199370b
|
@ -16,12 +16,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
TRAVIS_OS_NAME: linux
|
GH_OS_NAME: linux
|
||||||
BUILD_TARGET: android
|
BUILD_TARGET: android
|
||||||
# Simple let github action to build all (TODO: optimize in the future)
|
|
||||||
TRAVIS_PULL_REQUEST: true
|
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
GITHUB_CI: true
|
|
||||||
PYENV_VERSION: 2.7.18
|
PYENV_VERSION: 2.7.18
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -16,12 +16,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
TRAVIS_OS_NAME: osx
|
GH_OS_NAME: osx
|
||||||
BUILD_TARGET: ios
|
BUILD_TARGET: ios
|
||||||
# Simple let github action to build all (TODO: optimize in the future)
|
|
||||||
TRAVIS_PULL_REQUEST: true
|
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
GITHUB_CI: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -16,12 +16,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
TRAVIS_OS_NAME: linux
|
GH_OS_NAME: linux
|
||||||
BUILD_TARGET: linux
|
BUILD_TARGET: linux
|
||||||
# Simple let github action to build all (TODO: optimize in the future)
|
|
||||||
TRAVIS_PULL_REQUEST: true
|
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
GITHUB_CI: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -16,12 +16,9 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
TRAVIS_OS_NAME: osx
|
GH_OS_NAME: osx
|
||||||
BUILD_TARGET: osx
|
BUILD_TARGET: osx
|
||||||
# Simple let github action to build all (TODO: optimize in the future)
|
|
||||||
TRAVIS_PULL_REQUEST: true
|
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
GITHUB_CI: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -8,9 +8,6 @@ on:
|
||||||
env:
|
env:
|
||||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||||
BUILD_TYPE: Release
|
BUILD_TYPE: Release
|
||||||
# Simple let github action to build all (TODO: optimize in the future)
|
|
||||||
TRAVIS_PULL_REQUEST: true
|
|
||||||
GITHUB_CI: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
|
@ -37,7 +34,7 @@ jobs:
|
||||||
name: build-linux
|
name: build-linux
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
TRAVIS_OS_NAME: linux
|
GH_OS_NAME: linux
|
||||||
BUILD_TARGET: linux
|
BUILD_TARGET: linux
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -59,7 +56,7 @@ jobs:
|
||||||
- arm64-v8a
|
- arm64-v8a
|
||||||
- x86
|
- x86
|
||||||
env:
|
env:
|
||||||
TRAVIS_OS_NAME: linux
|
GH_OS_NAME: linux
|
||||||
BUILD_TARGET: android
|
BUILD_TARGET: android
|
||||||
PYENV_VERSION: 2.7.18
|
PYENV_VERSION: 2.7.18
|
||||||
BUILD_ARCH: ${{ matrix.arch }}
|
BUILD_ARCH: ${{ matrix.arch }}
|
||||||
|
@ -77,7 +74,7 @@ jobs:
|
||||||
name: build-osx
|
name: build-osx
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
env:
|
env:
|
||||||
TRAVIS_OS_NAME: osx
|
GH_OS_NAME: osx
|
||||||
BUILD_TARGET: osx
|
BUILD_TARGET: osx
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -93,7 +90,7 @@ jobs:
|
||||||
name: build-ios
|
name: build-ios
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
env:
|
env:
|
||||||
TRAVIS_OS_NAME: osx
|
GH_OS_NAME: osx
|
||||||
BUILD_TARGET: ios
|
BUILD_TARGET: ios
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
@ -46,11 +46,11 @@ function install_python_module_for_osx()
|
||||||
}
|
}
|
||||||
|
|
||||||
# set up environment according os and target
|
# set up environment according os and target
|
||||||
function install_environement_for_pull_request()
|
function install_environement()
|
||||||
{
|
{
|
||||||
echo "Building pull request ..."
|
echo "Installing environement ..."
|
||||||
|
|
||||||
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
if [ "$GH_OS_NAME" == "linux" ]; then
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install ninja-build
|
sudo apt-get install ninja-build
|
||||||
ninja --version
|
ninja --version
|
||||||
|
@ -67,7 +67,7 @@ function install_environement_for_pull_request()
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
if [ "$GH_OS_NAME" == "osx" ]; then
|
||||||
brew install nasm
|
brew install nasm
|
||||||
nasm -v
|
nasm -v
|
||||||
|
|
||||||
|
@ -75,67 +75,19 @@ function install_environement_for_pull_request()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# should generate binding codes & cocos_files.json after merging
|
|
||||||
# function install_environement_for_after_merge()
|
|
||||||
# {
|
|
||||||
# if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
|
||||||
# install_python_module_for_osx
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# echo "Building merge commit ..."
|
|
||||||
# }
|
|
||||||
|
|
||||||
# install newer python for android for ssl connection
|
# install newer python for android for ssl connection
|
||||||
if [ "$BUILD_TARGET" == "android" ]; then
|
if [ "$GH_OS_NAME" == "linux" ]; then
|
||||||
if [ $GITHUB_CI ]; then
|
|
||||||
echo "Installing pyenv for github ci..."
|
echo "Installing pyenv for github ci..."
|
||||||
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
|
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
|
||||||
export PATH="/home/runner/.pyenv/bin:$PATH"
|
export PATH="/home/runner/.pyenv/bin:$PATH"
|
||||||
else
|
|
||||||
# upgrade pyenv
|
|
||||||
cd $(pyenv root) && git checkout master && git pull && cd -
|
|
||||||
fi
|
|
||||||
pyenv install --list
|
pyenv install --list
|
||||||
pyenv install $PYENV_VERSION
|
pyenv install $PYENV_VERSION
|
||||||
pyenv versions
|
pyenv versions
|
||||||
# pip install pyOpenSSL ndg-httpsclient pyasn1
|
|
||||||
# set by PYENV_VERSION environment variable implicit
|
|
||||||
# pyenv global $PYENV_VERSION
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python -V
|
python -V
|
||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
|
install_environement
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install ninja-build
|
|
||||||
ninja --version
|
|
||||||
sudo pip install retry
|
|
||||||
python $ADXE_ROOT/tools/appveyor-scripts/setup_android.py
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then
|
|
||||||
install_linux_environment
|
|
||||||
# linux new lua project, so need to install
|
|
||||||
sudo pip install retry
|
|
||||||
python $ADXE_ROOT/tools/appveyor-scripts/setup_android.py --ndk_only
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# build pull request
|
|
||||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
||||||
install_environement_for_pull_request
|
|
||||||
fi
|
|
||||||
|
|
||||||
# run after merging
|
|
||||||
# - make cocos robot to send PR to cocos2d-x for new binding codes
|
|
||||||
# - generate cocos_files.json for template
|
|
||||||
# if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
||||||
# # only one job need to send PR, linux virtual machine has better performance
|
|
||||||
# if [ $TRAVIS_OS_NAME == "linux" ] && [ x$GEN_BINDING_AND_COCOSFILE == x"true" ]; then
|
|
||||||
# install_environement_for_after_merge
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
|
|
||||||
echo "before-install.sh execution finished!"
|
echo "before-install.sh execution finished!"
|
||||||
|
|
|
@ -5,7 +5,6 @@ set -e
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
ADXE_ROOT="$DIR"/../..
|
ADXE_ROOT="$DIR"/../..
|
||||||
COCOSFILE_PATH="$ADXE_ROOT/templates/cocos2dx_files.json"
|
|
||||||
CPU_CORES=4
|
CPU_CORES=4
|
||||||
|
|
||||||
function do_retry()
|
function do_retry()
|
||||||
|
@ -30,7 +29,6 @@ function do_retry()
|
||||||
|
|
||||||
function build_linux()
|
function build_linux()
|
||||||
{
|
{
|
||||||
echo "Building tests ..."
|
|
||||||
# source ../environment.sh
|
# source ../environment.sh
|
||||||
cd $ADXE_ROOT
|
cd $ADXE_ROOT
|
||||||
set -x
|
set -x
|
||||||
|
@ -43,17 +41,11 @@ function build_osx()
|
||||||
{
|
{
|
||||||
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
||||||
|
|
||||||
# pushd $ADXE_ROOT
|
|
||||||
# python -u tools/console/bin/adxe.py --agreement n new -l cpp -p my.pack.qqqq cocos_new_test
|
|
||||||
# popd
|
|
||||||
# cd $ADXE_ROOT/cocos_new_test
|
|
||||||
cd $ADXE_ROOT
|
cd $ADXE_ROOT
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cmake -S . -B build -GXcode -DBUILD_EXTENSION_IMGUIEXT=ON -DBUILD_DEP_ALSOFT=ON
|
cmake -S . -B build -GXcode -DBUILD_EXTENSION_IMGUIEXT=ON -DBUILD_DEP_ALSOFT=ON
|
||||||
cmake --build build --config Release --target cpp-tests -- -quiet
|
cmake --build build --config Release --target cpp-tests -- -quiet
|
||||||
#xcodebuild -project adxe.xcodeproj -alltargets -jobs $NUM_OF_CORES build | xcpretty
|
|
||||||
##the following commands must not be removed
|
|
||||||
#xcodebuild -project adxe.xcodeproj -alltargets -jobs $NUM_OF_CORES build
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,20 +53,12 @@ function build_ios()
|
||||||
{
|
{
|
||||||
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
||||||
|
|
||||||
# pushd $ADXE_ROOT
|
|
||||||
# python -u tools/console/bin/adxe.py --agreement n new -l cpp -p my.pack.qqqq cocos_new_test
|
|
||||||
# popd
|
|
||||||
# cd $ADXE_ROOT/cocos_new_test
|
|
||||||
cd $ADXE_ROOT
|
cd $ADXE_ROOT
|
||||||
# mkdir -p build
|
|
||||||
|
|
||||||
cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBUILD_DEP_ALSOFT=ON
|
cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 -DBUILD_DEP_ALSOFT=ON
|
||||||
# cmake .. -GXcode -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DCMAKE_SYSTEM_NAME=iOS -DPLATFORM=OS -DENABLE_ARC=0 # too much logs on console when "cmake --build ."
|
# cmake .. -GXcode -DCMAKE_TOOLCHAIN_FILE=../cmake/ios.toolchain.cmake -DCMAKE_SYSTEM_NAME=iOS -DPLATFORM=OS -DENABLE_ARC=0 # too much logs on console when "cmake --build ."
|
||||||
cmake --build build --config Release --target cpp-tests -- -quiet -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)"
|
cmake --build build --config Release --target cpp-tests -- -quiet -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)"
|
||||||
|
|
||||||
#xcodebuild -project adxe.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build | xcpretty
|
|
||||||
##the following commands must not be removed
|
|
||||||
#xcodebuild -project adxe.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,188 +75,17 @@ function build_android()
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_android_lua()
|
|
||||||
{
|
|
||||||
# Build all samples
|
|
||||||
echo "Building Android samples lua ..."
|
|
||||||
source ../environment.sh
|
|
||||||
|
|
||||||
# build lua-tests
|
|
||||||
pushd $ADXE_ROOT/tests/lua-tests/project/proj.android
|
|
||||||
do_retry ./gradlew assembleDebug -PPROP_BUILD_TYPE=cmake -PPROP_APP_ABI=arm64-v8a --parallel --info
|
|
||||||
popd
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function genernate_binding_codes()
|
|
||||||
{
|
|
||||||
if [ $TRAVIS_OS_NAME == "linux" ]; then
|
|
||||||
# print some log for libstdc++6
|
|
||||||
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
|
|
||||||
ls -l /usr/lib/x86_64-linux-gnu/libstdc++*
|
|
||||||
dpkg-query -W libstdc++6
|
|
||||||
ldd $ADXE_ROOT/tools/bindings-generator/libclang/libclang.so
|
|
||||||
fi
|
|
||||||
|
|
||||||
source ../environment.sh
|
|
||||||
|
|
||||||
# Generate binding glue codes
|
|
||||||
|
|
||||||
echo "Create auto-generated luabinding glue codes."
|
|
||||||
pushd "$ADXE_ROOT/tools/tolua"
|
|
||||||
# python ./genbindings.py
|
|
||||||
popd
|
|
||||||
}
|
|
||||||
|
|
||||||
# generate cocos_files.json and check diff
|
|
||||||
function update_cocos_files()
|
|
||||||
{
|
|
||||||
# Don't exit on non-zero return value
|
|
||||||
set +e
|
|
||||||
echo "Updates cocos_files.json"
|
|
||||||
$ADXE_ROOT/tools/travis-scripts/generate-template-files.py
|
|
||||||
git diff FETCH_HEAD --stat --exit-code "$COCOSFILE_PATH"
|
|
||||||
COCOSFILE_DIFF_RETVAL=$?
|
|
||||||
echo $COCOSFILE_DIFF_RETVAL
|
|
||||||
|
|
||||||
# Exit on error
|
|
||||||
set -e
|
|
||||||
}
|
|
||||||
|
|
||||||
function generate_pull_request_for_binding_codes_and_cocosfiles()
|
|
||||||
{
|
|
||||||
local COCOS_ROBOT_REMOTE="https://${GH_USER}:${GH_PASSWORD}@github.com/${GH_USER}/adxe.git"
|
|
||||||
local LUA_AUTO_GENERATE_SCRIPT_PATH="$ADXE_ROOT/extensions/scripting/lua-bindings/auto"
|
|
||||||
local ELAPSEDSECS=`date +%s`
|
|
||||||
local COCOS_BRANCH="update_lua_bindings_$ELAPSEDSECS"
|
|
||||||
local COMMITTAG="[ci skip][AUTO]: updating luabinding & cocos_file.json automatically"
|
|
||||||
local PULL_REQUEST_REPO="https://api.github.com/repos/cocos2d/cocos2d-x/pulls"
|
|
||||||
|
|
||||||
pushd "$ADXE_ROOT"
|
|
||||||
#Set git user for cocos2d-lua repo
|
|
||||||
# git config user.email ${GH_EMAIL}
|
|
||||||
# git config user.name ${GH_USER}#Set remotes
|
|
||||||
# git remote add upstream "$COCOS_ROBOT_REMOTE" 2> /dev/null > /dev/null
|
|
||||||
|
|
||||||
# Run status to record the output in the log
|
|
||||||
git status
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo Comparing with origin HEAD ...
|
|
||||||
echo
|
|
||||||
git fetch origin "$TRAVIS_BRANCH"
|
|
||||||
|
|
||||||
# Don't exit on non-zero return value
|
|
||||||
set +e
|
|
||||||
git diff FETCH_HEAD --stat --exit-code "$LUA_AUTO_GENERATE_SCRIPT_PATH"
|
|
||||||
local lua_binding_codes_diff=$?
|
|
||||||
|
|
||||||
# generate cocos_files.json and check diff
|
|
||||||
local cocos_file_diff=$(update_cocos_files)
|
|
||||||
if [ $lua_binding_codes_diff -eq 0 ] && [ $cocos_file_diff -eq 0 ]; then
|
|
||||||
echo "lua binding codes and cocos file are not differences"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Exit on error
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# git add -f --all "$LUA_AUTO_GENERATE_SCRIPT_PATH"
|
|
||||||
# git add -f --all "$COCOSFILE_PATH"
|
|
||||||
# git checkout -b "$COCOS_BRANCH"
|
|
||||||
# git commit -m "$COMMITTAG"
|
|
||||||
|
|
||||||
echo "Pushing to Robot's repo ..."
|
|
||||||
# git fetch --unshallow origin
|
|
||||||
# git push -f upstream "$COCOS_BRANCH"
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
popd
|
|
||||||
}
|
|
||||||
|
|
||||||
function run_build()
|
function run_build()
|
||||||
{
|
{
|
||||||
echo "Building..."
|
echo "Building..."
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
|
|
||||||
source ../environment.sh
|
|
||||||
pushd $ADXE_ROOT
|
|
||||||
update_cocos_files
|
|
||||||
python -u tools/console/bin/adxe.py --agreement n new -l cpp -p my.pack.qqqq cocos_new_test
|
|
||||||
popd
|
|
||||||
pushd $ADXE_ROOT/cocos_new_test/proj.android
|
|
||||||
do_retry ./gradlew build
|
|
||||||
popd
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then
|
|
||||||
export PATH=$PATH:$ADXE_ROOT/tools/console/bin
|
|
||||||
genernate_binding_codes
|
|
||||||
pushd $ADXE_ROOT
|
|
||||||
update_cocos_files
|
|
||||||
python -u tools/console/bin/adxe.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test
|
|
||||||
popd
|
|
||||||
echo "Building tests ..."
|
|
||||||
|
|
||||||
set -x
|
|
||||||
cd $ADXE_ROOT/cocos_new_test
|
|
||||||
mkdir -p linux-build
|
|
||||||
cd linux-build
|
|
||||||
cmake .. -G"Unix Makefiles"
|
|
||||||
cmake --build . -- -j `nproc`
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "ios_cocos_new_lua_test" ]; then
|
|
||||||
export PATH=$PATH:$ADXE_ROOT/tools/console/bin
|
|
||||||
#NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
|
||||||
genernate_binding_codes
|
|
||||||
pushd $ADXE_ROOT
|
|
||||||
echo "Creating tests ..."
|
|
||||||
|
|
||||||
set -x
|
|
||||||
cocos --agreement n new -l lua ios_new_lua_proj
|
|
||||||
cd ios_new_lua_proj
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
|
|
||||||
cmake --build . --config Release -- -quiet
|
|
||||||
popd
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BUILD_TARGET" == "ios_cocos_new_cpp_test" ]; then
|
|
||||||
export PATH=$PATH:$ADXE_ROOT/tools/console/bin
|
|
||||||
#NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
|
|
||||||
genernate_binding_codes
|
|
||||||
pushd $ADXE_ROOT
|
|
||||||
echo "Creating tests ..."
|
|
||||||
|
|
||||||
set -x
|
|
||||||
cocos --agreement n new -l cpp ios_new_cpp_proj
|
|
||||||
cd ios_new_cpp_proj
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
echo "Building tests ..."
|
|
||||||
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
|
|
||||||
cmake --build . --config Release -- -quiet
|
|
||||||
popd
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $BUILD_TARGET == 'osx' ]; then
|
if [ $BUILD_TARGET == 'osx' ]; then
|
||||||
# genernate_binding_codes
|
|
||||||
set -x
|
set -x
|
||||||
build_osx
|
build_osx
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $BUILD_TARGET == 'ios' ]; then
|
if [ $BUILD_TARGET == 'ios' ]; then
|
||||||
# genernate_binding_codes
|
|
||||||
set -x
|
set -x
|
||||||
build_ios
|
build_ios
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -280,7 +93,6 @@ function run_build()
|
||||||
|
|
||||||
# linux
|
# linux
|
||||||
if [ $BUILD_TARGET == 'linux' ]; then
|
if [ $BUILD_TARGET == 'linux' ]; then
|
||||||
# genernate_binding_codes
|
|
||||||
build_linux
|
build_linux
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -288,52 +100,7 @@ function run_build()
|
||||||
if [ $BUILD_TARGET == 'android' ]; then
|
if [ $BUILD_TARGET == 'android' ]; then
|
||||||
build_android
|
build_android
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# android_lua
|
|
||||||
if [ $BUILD_TARGET == 'android_lua' ]; then
|
|
||||||
genernate_binding_codes
|
|
||||||
build_android_lua
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function run_after_merge()
|
|
||||||
{
|
|
||||||
echo "Building merge commit ..."
|
|
||||||
# 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
|
|
||||||
# GH_USER/GH_EMAIL/GH_PASSWORD environment variables are not set correctly
|
|
||||||
# by the encoded variables in the .travis.yml file. (e.g. if cloned repo's
|
|
||||||
# want to use travis).
|
|
||||||
# if [ -z "${GH_EMAIL}" ]; then
|
|
||||||
# echo "GH_EMAIL not set"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
# if [ -z "${GH_USER}" ]; then
|
|
||||||
# echo "GH_USER not set"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
# if [ -z "${GH_PASSWORD}" ]; then
|
|
||||||
# echo "GH_USER not set"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
genernate_binding_codes
|
|
||||||
generate_pull_request_for_binding_codes_and_cocosfiles
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_build
|
run_build
|
||||||
|
|
||||||
# build pull request
|
|
||||||
# if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
||||||
# run_pull_request
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# run after merging
|
|
||||||
# - make cocos robot to send PR to cocos2d-x for new binding codes
|
|
||||||
# - generate cocos_files.json for template
|
|
||||||
# if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
|
||||||
# # only one job need to send PR, linux virtual machine has better performance
|
|
||||||
# if [ $TRAVIS_OS_NAME == "linux" ] && [ x$GEN_BINDING_AND_COCOSFILE == x"true" ]; then
|
|
||||||
# run_after_merge
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
|
|
Loading…
Reference in New Issue