aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-10-23 15:00:42 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-11-28 15:58:37 +0100
commitca3a64c024ae817ca38b1df87123f341637c8bd4 (patch)
tree4992d69bc115551c2759e1853126e70eb9c66e3f /sources/pyside-tools
parent120a14487c86c96cf4818e04b9e919be6495151d (diff)
Android Deployment: Add QtQuick dependency when present
- Currently the dependencies are identified by checking the dependency files shipped with Qt and checking the Python files related to the project for PySide imports, to identify the Qt modules used. - This patch extends the dependency check by also checking the QML files related to the project for QtQuick and QtQuickControls2 import. Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ia92ff9c2d06c383a6357b69f0f19160b1b522afa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools')
-rw-r--r--sources/pyside-tools/deploy_lib/android/android_config.py14
-rw-r--r--sources/pyside-tools/deploy_lib/config.py5
2 files changed, 17 insertions, 2 deletions
diff --git a/sources/pyside-tools/deploy_lib/android/android_config.py b/sources/pyside-tools/deploy_lib/android/android_config.py
index a6b2cf052..8ff16537b 100644
--- a/sources/pyside-tools/deploy_lib/android/android_config.py
+++ b/sources/pyside-tools/deploy_lib/android/android_config.py
@@ -91,6 +91,7 @@ class AndroidConfig(Config):
self.modules = self.get_value("buildozer", "modules").split(",")
else:
self._find_and_set_pysidemodules()
+ self._find_and_set_qtquick_modules()
self._arch = None
if self.get_value("buildozer", "arch"):
@@ -240,3 +241,16 @@ class AndroidConfig(Config):
if not self.arch:
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 "QtQuick" in self.qml_modules:
+ extra_modules.append("Quick")
+
+ if "QtQuick.Controls" in self.qml_modules:
+ extra_modules.append("QuickControls2")
+
+ self.modules += extra_modules
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py
index 94a287eaf..57eec3d1f 100644
--- a/sources/pyside-tools/deploy_lib/config.py
+++ b/sources/pyside-tools/deploy_lib/config.py
@@ -65,6 +65,7 @@ class Config(BaseConfig):
super().__init__(config_file=config_file, existing_config_file=existing_config_file)
self._dry_run = dry_run
+ self.qml_modules = set()
# set source_file
self.source_file = Path(
self.set_or_fetch(config_property_val=source_file, config_property_key="input_file")
@@ -295,9 +296,9 @@ class Config(BaseConfig):
def _find_and_set_excluded_qml_plugins(self):
if self.qml_files:
- included_qml_modules = set(run_qmlimportscanner(qml_files=self.qml_files,
+ self.qml_modules = set(run_qmlimportscanner(qml_files=self.qml_files,
dry_run=self.dry_run))
- self.excluded_qml_plugins = EXCLUDED_QML_PLUGINS.difference(included_qml_modules)
+ self.excluded_qml_plugins = EXCLUDED_QML_PLUGINS.difference(self.qml_modules)
# needed for dry_run testing
self.excluded_qml_plugins = sorted(self.excluded_qml_plugins)