Skip to content

refine travis, don't generate binding codes for cpp only target #19430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ matrix:
sudo: required
# android ndk-build
- os: linux
env: BUILD_TARGET=android_ndk-build
env: BUILD_TARGET=android_cpp_ndk-build
language: android
sudo: required
# android_lua ndk-build
Expand All @@ -35,7 +35,7 @@ matrix:
sudo: required
# android cmake
- os: linux
env: BUILD_TARGET=android_cmake
env: BUILD_TARGET=android_cpp_cmake
language: android
sudo: required
# android_lua cmake
Expand All @@ -61,12 +61,12 @@ matrix:
osx_image: xcode9.3
sudo: required
- os: linux
env: BUILD_TARGET=android_cocos_new_test
env: BUILD_TARGET=android_cocos_new_cpp_test
language: android
sudo: required
- os: linux
dist: xenial
env: BUILD_TARGET=linux_cocos_new_test
env: BUILD_TARGET=linux_cocos_new_lua_test
language: cpp
sudo: required

Expand Down
8 changes: 5 additions & 3 deletions tools/appveyor-scripts/before-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ Download-Deps

& python -m pip install retry

# need to generate binding codes for all targets
& $python -u .\tools\appveyor-scripts\setup_android.py --ndk_only
Generate-Binding-Codes
# don't need generate binding codes for cpp only target
If ($env:build_type -ne "android_cpp_tests") {
& $python -u .\tools\appveyor-scripts\setup_android.py --ndk_only
Generate-Binding-Codes
}

If ($env:build_type -like "android*") {
& choco install ninja
Expand Down
8 changes: 4 additions & 4 deletions tools/travis-scripts/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ CURL="curl --retry 999 --retry-max-time 0"
function install_android_ndk()
{
sudo python -m pip install retry
if [ "$BUILD_TARGET" == "android_ndk-build" ]\
if [ "$BUILD_TARGET" == "android_cpp_ndk-build" ]\
|| [ "$BUILD_TARGET" == "android_lua_ndk-build" ]\
|| [ "$BUILD_TARGET" == "android_cmake" ]\
|| [ "$BUILD_TARGET" == "android_cpp_cmake" ]\
|| [ "$BUILD_TARGET" == "android_js_cmake" ]\
|| [ "$BUILD_TARGET" == "android_lua_cmake" ] ; then
python $COCOS2DX_ROOT/tools/appveyor-scripts/setup_android.py
Expand Down Expand Up @@ -90,7 +90,7 @@ function install_environement_for_after_merge()
download_deps
}

if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then
sudo apt-get update
sudo apt-get install ninja-build
ninja --version
Expand All @@ -100,7 +100,7 @@ if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
exit 0
fi

if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then
if [ "$BUILD_TARGET" == "linux_cocos_new_lua_test" ]; then
download_deps
install_linux_environment
sudo python -m pip install retry
Expand Down
28 changes: 17 additions & 11 deletions tools/travis-scripts/run-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function build_ios_cmake()
exit 0
}

function build_android_ndk-build()
function build_android_cpp_ndk-build()
{
# Build all samples
echo "Building Android samples ..."
Expand All @@ -117,7 +117,7 @@ function build_android_ndk-build()
# popd
}

function build_android_cmake()
function build_android_cpp_cmake()
{
# Build all samples
echo "Building Android samples ..."
Expand Down Expand Up @@ -287,47 +287,55 @@ function run_pull_request()
{
# linux
if [ $BUILD_TARGET == 'linux' ]; then
genernate_binding_codes
build_linux
fi

# android
if [ $BUILD_TARGET == 'android_ndk-build' ]; then
build_android_ndk-build
if [ $BUILD_TARGET == 'android_cpp_ndk-build' ]; then
build_android_cpp_ndk-build
fi

# android
if [ $BUILD_TARGET == 'android_cmake' ]; then
build_android_cmake
if [ $BUILD_TARGET == 'android_cpp_cmake' ]; then
build_android_cpp_cmake
fi

# android_lua
if [ $BUILD_TARGET == 'android_lua_ndk-build' ]; then
genernate_binding_codes
build_android_lua_ndk-build
fi

# android_lua
if [ $BUILD_TARGET == 'android_lua_cmake' ]; then
genernate_binding_codes
build_android_lua_cmake
fi

# android_js
if [ $BUILD_TARGET == 'android_js_cmake' ]; then
genernate_binding_codes
build_android_js_cmake
fi

if [ $BUILD_TARGET == 'mac' ]; then
genernate_binding_codes
build_mac
fi

if [ $BUILD_TARGET == 'ios' ]; then
genernate_binding_codes
build_ios
fi

if [ $BUILD_TARGET == 'mac_cmake' ]; then
genernate_binding_codes
build_mac_cmake
fi

if [ $BUILD_TARGET == 'ios_cmake' ]; then
genernate_binding_codes
build_ios_cmake
fi
}
Expand Down Expand Up @@ -362,10 +370,7 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then

echo "Building pull request ..."

# need to generate binding codes for all targets
genernate_binding_codes

if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then
source ../environment.sh
pushd $COCOS2DX_ROOT
update_cocos_files
Expand All @@ -377,7 +382,8 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
exit 0
fi

if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then
if [ "$BUILD_TARGET" == "linux_cocos_new_lua_test" ]; then
genernate_binding_codes
pushd $COCOS2DX_ROOT
update_cocos_files
python -u tools/cocos2d-console/bin/cocos.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test
Expand Down