diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-10 12:19:10 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-11 12:12:32 +0200 |
| commit | a7f7ab6ef12005f4ca86c5a4934c33d2539a23e5 (patch) | |
| tree | b6bba2aa958c26c8f9c1cea95f5a7a4ec081ae9f /sources/pyside-tools/deploy_lib/android | |
| parent | bcfd0a1ad2f1c333b53db071fe40b2ee3569bd6b (diff) | |
Deployment: More code fixes
- Formatting and text updates.
- extract_and_copy_jar() returns the extracted path to the jar
directory
- Buildozer class is now initialized when `pyside6-android-deploy` is
run with --init. This is because it updates the recipes folder.
- Buildozer defaults for Android NDK cannot be used anymore because
`pyside6-android-deploy` uses llvm-readelf from the NDK to find the
binary dependencies.
- Change print statement to RuntimeError incase `main.py` does not exist
- Change logging.exception to RuntimeError for the function
`find_pyside_modules`
Pick-to: 6.6
Task-number: PYSIDE-1612
Change-Id: I6ef5d5dfe9acae5f0029553ca2c6f07d91b6e462
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/android')
| -rw-r--r-- | sources/pyside-tools/deploy_lib/android/android_helper.py | 11 | ||||
| -rw-r--r-- | sources/pyside-tools/deploy_lib/android/buildozer.py | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/sources/pyside-tools/deploy_lib/android/android_helper.py b/sources/pyside-tools/deploy_lib/android/android_helper.py index 58efa0943..4489909d5 100644 --- a/sources/pyside-tools/deploy_lib/android/android_helper.py +++ b/sources/pyside-tools/deploy_lib/android/android_helper.py @@ -30,9 +30,9 @@ def create_recipe(version: str, component: str, wheel_path: str, generated_files ''' Create python_for_android recipe for PySide6 and shiboken6 ''' - qt_plugins = [] + qt_plugins = [] if plugins: - #split plugins based on category + # split plugins based on category for plugin in plugins: plugin_category, plugin_name = plugin.split('_', 1) qt_plugins.append((plugin_category, plugin_name)) @@ -70,7 +70,7 @@ def extract_and_copy_jar(wheel_path: Path, generated_files_path: Path) -> str: jar_files = [file for file in archive.namelist() if file.startswith("PySide6/jar")] for file in jar_files: archive.extract(file, jar_path) - return jar_path + return (jar_path / "PySide6" / "jar").resolve() if jar_files else None def get_wheel_android_arch(wheel: Path): @@ -89,11 +89,6 @@ def get_llvm_readobj(ndk_path: Path) -> Path: ''' Return the path to llvm_readobj from the Android Ndk ''' - if not ndk_path: - # fetch ndk path from buildozer - raise FileNotFoundError("[DEPLOY] Unable to find Ndk path. Please pass the Ndk path either" - " from the CLI or from pysidedeploy.spec") - # TODO: Requires change if Windows platform supports Android Deployment or if we # support host other than linux-x86_64 return (ndk_path / "toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readobj") diff --git a/sources/pyside-tools/deploy_lib/android/buildozer.py b/sources/pyside-tools/deploy_lib/android/buildozer.py index 647951a09..3d187fa60 100644 --- a/sources/pyside-tools/deploy_lib/android/buildozer.py +++ b/sources/pyside-tools/deploy_lib/android/buildozer.py @@ -111,7 +111,7 @@ class BuildozerConfig(BaseConfig): self.set_value("app", "android.add_jars", ",".join(jars)) init_classes = ",".join(init_classes) - #extra arguments specific to Qt + # extra arguments specific to Qt extra_args = (f"--qt-libs={modules} --load-local-libs={local_libs}" f" --init-classes={init_classes}") self.set_value("app", "p4a.extra_args", extra_args) |
