Skip to content

Commit d7212ea

Browse files
drelaptopminggo
authored and
minggo
committed
refine travis, don't generate binding codes for cpp only target (#19430)
1 parent 0e996a9 commit d7212ea

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

Diff for: .travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ matrix:
2525
sudo: required
2626
# android ndk-build
2727
- os: linux
28-
env: BUILD_TARGET=android_ndk-build
28+
env: BUILD_TARGET=android_cpp_ndk-build
2929
language: android
3030
sudo: required
3131
# android_lua ndk-build
@@ -35,7 +35,7 @@ matrix:
3535
sudo: required
3636
# android cmake
3737
- os: linux
38-
env: BUILD_TARGET=android_cmake
38+
env: BUILD_TARGET=android_cpp_cmake
3939
language: android
4040
sudo: required
4141
# android_lua cmake
@@ -61,12 +61,12 @@ matrix:
6161
osx_image: xcode9.3
6262
sudo: required
6363
- os: linux
64-
env: BUILD_TARGET=android_cocos_new_test
64+
env: BUILD_TARGET=android_cocos_new_cpp_test
6565
language: android
6666
sudo: required
6767
- os: linux
6868
dist: xenial
69-
env: BUILD_TARGET=linux_cocos_new_test
69+
env: BUILD_TARGET=linux_cocos_new_lua_test
7070
language: cpp
7171
sudo: required
7272

Diff for: tools/appveyor-scripts/before-build.ps1

+5-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ Download-Deps
4040

4141
& python -m pip install retry
4242

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

4749
If ($env:build_type -like "android*") {
4850
& choco install ninja

Diff for: tools/travis-scripts/before-install.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ CURL="curl --retry 999 --retry-max-time 0"
1111
function install_android_ndk()
1212
{
1313
sudo python -m pip install retry
14-
if [ "$BUILD_TARGET" == "android_ndk-build" ]\
14+
if [ "$BUILD_TARGET" == "android_cpp_ndk-build" ]\
1515
|| [ "$BUILD_TARGET" == "android_lua_ndk-build" ]\
16-
|| [ "$BUILD_TARGET" == "android_cmake" ]\
16+
|| [ "$BUILD_TARGET" == "android_cpp_cmake" ]\
1717
|| [ "$BUILD_TARGET" == "android_js_cmake" ]\
1818
|| [ "$BUILD_TARGET" == "android_lua_cmake" ] ; then
1919
python $COCOS2DX_ROOT/tools/appveyor-scripts/setup_android.py
@@ -90,7 +90,7 @@ function install_environement_for_after_merge()
9090
download_deps
9191
}
9292

93-
if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
93+
if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then
9494
sudo apt-get update
9595
sudo apt-get install ninja-build
9696
ninja --version
@@ -100,7 +100,7 @@ if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
100100
exit 0
101101
fi
102102

103-
if [ "$BUILD_TARGET" == "linux_cocos_new_test" ]; then
103+
if [ "$BUILD_TARGET" == "linux_cocos_new_lua_test" ]; then
104104
download_deps
105105
install_linux_environment
106106
sudo python -m pip install retry

Diff for: tools/travis-scripts/run-script.sh

+17-11
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function build_ios_cmake()
9494
exit 0
9595
}
9696

97-
function build_android_ndk-build()
97+
function build_android_cpp_ndk-build()
9898
{
9999
# Build all samples
100100
echo "Building Android samples ..."
@@ -117,7 +117,7 @@ function build_android_ndk-build()
117117
# popd
118118
}
119119

120-
function build_android_cmake()
120+
function build_android_cpp_cmake()
121121
{
122122
# Build all samples
123123
echo "Building Android samples ..."
@@ -287,47 +287,55 @@ function run_pull_request()
287287
{
288288
# linux
289289
if [ $BUILD_TARGET == 'linux' ]; then
290+
genernate_binding_codes
290291
build_linux
291292
fi
292293

293294
# android
294-
if [ $BUILD_TARGET == 'android_ndk-build' ]; then
295-
build_android_ndk-build
295+
if [ $BUILD_TARGET == 'android_cpp_ndk-build' ]; then
296+
build_android_cpp_ndk-build
296297
fi
297298

298299
# android
299-
if [ $BUILD_TARGET == 'android_cmake' ]; then
300-
build_android_cmake
300+
if [ $BUILD_TARGET == 'android_cpp_cmake' ]; then
301+
build_android_cpp_cmake
301302
fi
302303

303304
# android_lua
304305
if [ $BUILD_TARGET == 'android_lua_ndk-build' ]; then
306+
genernate_binding_codes
305307
build_android_lua_ndk-build
306308
fi
307309

308310
# android_lua
309311
if [ $BUILD_TARGET == 'android_lua_cmake' ]; then
312+
genernate_binding_codes
310313
build_android_lua_cmake
311314
fi
312315

313316
# android_js
314317
if [ $BUILD_TARGET == 'android_js_cmake' ]; then
318+
genernate_binding_codes
315319
build_android_js_cmake
316320
fi
317321

318322
if [ $BUILD_TARGET == 'mac' ]; then
323+
genernate_binding_codes
319324
build_mac
320325
fi
321326

322327
if [ $BUILD_TARGET == 'ios' ]; then
328+
genernate_binding_codes
323329
build_ios
324330
fi
325331

326332
if [ $BUILD_TARGET == 'mac_cmake' ]; then
333+
genernate_binding_codes
327334
build_mac_cmake
328335
fi
329336

330337
if [ $BUILD_TARGET == 'ios_cmake' ]; then
338+
genernate_binding_codes
331339
build_ios_cmake
332340
fi
333341
}
@@ -362,10 +370,7 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
362370

363371
echo "Building pull request ..."
364372

365-
# need to generate binding codes for all targets
366-
genernate_binding_codes
367-
368-
if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
373+
if [ "$BUILD_TARGET" == "android_cocos_new_cpp_test" ]; then
369374
source ../environment.sh
370375
pushd $COCOS2DX_ROOT
371376
update_cocos_files
@@ -377,7 +382,8 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
377382
exit 0
378383
fi
379384

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

0 commit comments

Comments
 (0)