Skip to content

Commit

Permalink
set android apk api level from build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JeyRunner committed Jan 7, 2017
1 parent 91cd359 commit 7e2fce8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android:
- tools
- platform-tools
- build-tools-23.0.2
- android-18
- android-16

addons:
apt:
Expand All @@ -25,7 +25,7 @@ before_install:
install:
- sudo apt-get install build-essential

script: python build.py --android 18 --native
script: python build.py --android 16 --native


before_deploy:
Expand Down
11 changes: 9 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,23 @@ def crossAndroid(api, abi):
"[ANDROID] API '%s'" % api, CYAN)

okABIs = ''
errABIS = ''

for abi in abiList:
chdir('cmake-android/' + abi)
print("[ANDROID] build abi '%s'" % abi)
run(['cmake',
'-DCMAKE_TOOLCHAIN_FILE=' + ANDROID_TOOLCHAIN,
'-DANDROID_NATIVE_API_LEVEL=' + api,
'-DANDROID_APK_API_LEVEL=' + api,
'-DANDROID_ABI=' + abi,
'-DCMAKE_BUILD_TYPE=Debug',
'' + rootSrc])
ok = not call(['make'])#, '-j', '8'])
if ok:
okABIs += abi + ", "
else:
errABIS += abi + ", "



Expand All @@ -141,8 +145,11 @@ def crossAndroid(api, abi):

setError(okApk)
print("\n[ANDROID] -- summary ----------------------------------")
printOk("[ANDROID] " + ("SUCCESSFULLY build for '" + okABIs + "'" if (okABIs != '') else 'ERROR'), okABIs != '')
printOk("[ANDROID] build APK %s " % ('SUCCESSFULLY' if okApk else 'ERROR'), okApk)
printOk("[ANDROID] " + ("SUCCESSFULLY build for '" + okABIs + "'" if (okABIs != '') else 'all builds ERROR'), okABIs != '')
if errABIS != '':
printCol("[ANDROID] " + "ERROR at build for '" + errABIS + "'", RED)
if packing:
printOk("[ANDROID] build APK %s " % ('SUCCESSFULLY' if okApk else 'ERROR'), okApk)



Expand Down
1 change: 1 addition & 0 deletions cmake/android.apk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(ANDROID_THIS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) # Directory this CMake fil
macro(android_create_apk name apk_package_name apk_directory libs_directory android_directory assets_directory)
set(ANDROID_NAME ${name})
set(ANDROID_APK_PACKAGE ${apk_package_name})
message(STATUS api: ${ANDROID_APK_API_LEVEL})

set(ANDROID_BUILD_APK_TARGET BuildApk)
set(ANDROID_INSTALL_TARGET InstallApk)
Expand Down

0 comments on commit 7e2fce8

Please sign in to comment.