aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/android/android_config.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-01-31 16:33:05 +0100
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-03-06 17:05:02 +0100
commit7526d9c4aa884a9d03700a76751158fd9c8bfece (patch)
treedf4b3136e4b9175c768b17ee152a5c299380f2be /sources/pyside-tools/deploy_lib/android/android_config.py
parentfe62a95fe11cf2b4904fa09c57996089505a9438 (diff)
Deployment: Find dependent modules
- Based on the desktop platform, find all the Qt module dependencies of the application just like Android. These dependencies can help in optimizing the plugins packaged with the application. - Desktop deployment has new cl arguments: --extra-ignore-dirs and --extra-modules that further complements finding the Qt modules used by the application. - Since the Qt dependencies are also required for desktop deployment, 'modules' field in pysidedeploy.spec is moved from under 'buildozer' key to 'qt' key. - dependency finding code moved to dependency_util.py. This also helps in list the imports without conflicts in deploy_lib/__init__.py. - Fix tests. Skip the deploy tests for macOS 11 as the CI does not include dyld_info either via XCode or CommandLineTools. Task-number: PYSIDE-1612 Change-Id: I3524e1996bfec76c5635d1b35ccbc4ecd6ba7b8d Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/android/android_config.py')
-rw-r--r--sources/pyside-tools/deploy_lib/android/android_config.py26
1 files changed, 4 insertions, 22 deletions
diff --git a/sources/pyside-tools/deploy_lib/android/android_config.py b/sources/pyside-tools/deploy_lib/android/android_config.py
index 8054ce373..417656bb0 100644
--- a/sources/pyside-tools/deploy_lib/android/android_config.py
+++ b/sources/pyside-tools/deploy_lib/android/android_config.py
@@ -12,8 +12,7 @@ from pkginfo import Wheel
from . import (extract_and_copy_jar, get_wheel_android_arch, find_lib_dependencies,
get_llvm_readobj, find_qtlibs_in_wheel, platform_map, create_recipe)
-from .. import (Config, find_pyside_modules, run_qmlimportscanner, get_all_pyside_modules,
- MAJOR_VERSION)
+from .. import (Config, find_pyside_modules, get_all_pyside_modules, MAJOR_VERSION)
ANDROID_NDK_VERSION = "25c"
ANDROID_DEPLOY_CACHE = Path.home() / ".pyside6_android_deploy"
@@ -107,9 +106,8 @@ class AndroidConfig(Config):
self.qt_libs_path: zipfile.Path = find_qtlibs_in_wheel(wheel_pyside=self.wheel_pyside)
logging.info(f"[DEPLOY] Qt libs path inside wheel: {str(self.qt_libs_path)}")
- self._modules = []
- if self.get_value("buildozer", "modules"):
- self.modules = self.get_value("buildozer", "modules").split(",")
+ if self.get_value("qt", "modules"):
+ self.modules = self.get_value("qt", "modules").split(",")
else:
self._find_and_set_pysidemodules()
self._find_and_set_qtquick_modules()
@@ -190,7 +188,7 @@ class AndroidConfig(Config):
@modules.setter
def modules(self, modules):
self._modules = modules
- self.set_value("buildozer", "modules", ",".join(modules))
+ self.set_value("qt", "modules", ",".join(modules))
@property
def local_libs(self):
@@ -282,22 +280,6 @@ class AndroidConfig(Config):
raise RuntimeError("[DEPLOY] PySide wheel corrupted. Wheel name should end with"
"platform name")
- def _find_and_set_qtquick_modules(self):
- """Identify if QtQuick is used in QML files and add them as dependency
- """
- extra_modules = []
- if not self.qml_modules:
- self.qml_modules = set(run_qmlimportscanner(qml_files=self.qml_files,
- dry_run=self.dry_run))
-
- if "QtQuick" in self.qml_modules:
- extra_modules.append("Quick")
-
- if "QtQuick.Controls" in self.qml_modules:
- extra_modules.append("QuickControls2")
-
- self.modules += extra_modules
-
def _find_dependent_qt_modules(self):
"""
Given pysidedeploy_config.modules, find all the other dependent Qt modules. This is