aboutsummaryrefslogtreecommitdiffstats
path: root/tools/cross_compile_android/main.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-11-11 14:32:18 +0100
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-11-12 10:01:15 +0100
commitbfe1814b767b71ffc3854038ec1d2961e258ae01 (patch)
tree8e3896d988da1101dbe5a847c9963bd25919d31f /tools/cross_compile_android/main.py
parent16b668274c279730cf0e0d2ec2656e72c539c749 (diff)
Android Deployment: Fix bug with non provided ndk_path and sdk_path
- Updates de524f258c3980814fbc724ed61816894403fa3f. Basically the download part should be outside the 'if download_only' block because otherwise the ndk_path and sdk_path would remain None when ndk_path and sdk_path are not provided via command line arguments. - Adds some error handling to the NDK and Command Line Tools download functions. Pick-to: 6.8 Task-number: PYSIDE-1612 Change-Id: I545f148caf1c185a1a2cbeeebd5aad3a5359d52b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'tools/cross_compile_android/main.py')
-rw-r--r--tools/cross_compile_android/main.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/cross_compile_android/main.py b/tools/cross_compile_android/main.py
index bf35c1473..2884793ca 100644
--- a/tools/cross_compile_android/main.py
+++ b/tools/cross_compile_android/main.py
@@ -185,19 +185,19 @@ if __name__ == "__main__":
if toolchain_path.is_file():
toolchain_path.unlink()
- if download_only:
- if not ndk_path:
- # Download android ndk
- ndk_path = download_android_ndk(pyside6_deploy_cache)
-
- if not sdk_path:
- # download and unzip command-line tools
- sdk_path = download_android_commandlinetools(pyside6_deploy_cache)
- # install and update required android packages
- install_android_packages(android_sdk_dir=sdk_path, android_api=api_level,
- dry_run=dry_run, accept_license=auto_accept_license,
- skip_update=skip_update)
+ if not ndk_path:
+ # Download android ndk
+ ndk_path = download_android_ndk(pyside6_deploy_cache)
+
+ if not sdk_path:
+ # download and unzip command-line tools
+ sdk_path = download_android_commandlinetools(pyside6_deploy_cache)
+ # install and update required android packages
+ install_android_packages(android_sdk_dir=sdk_path, android_api=api_level,
+ dry_run=dry_run, accept_license=auto_accept_license,
+ skip_update=skip_update)
+ if download_only:
print(f"Android NDK and SDK downloaded successfully into {pyside6_deploy_cache}")
sys.exit(0)