aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/android
diff options
context:
space:
mode:
authorShyamnath Premnadh <shyamnath.premnadh@qt.io>2023-04-04 16:18:47 +0200
committerShyamnath Premnadh <shyamnath.premnadh@qt.io>2023-04-17 11:12:55 +0200
commit0e40c7af91df19a2ac20d88b55d4ef4d71845c55 (patch)
treeb1002ad68cba00384ea0ee5c390c088ea630afe1 /sources/pyside-tools/deploy_lib/android
parentb80c7822c61b70d9704b42db64db0d9637fa7079 (diff)
Deployment: Refactoring
- Fix --dry-run in Android deployment - Add option to control raising a warning when adding new entries to config file - Remove unnecessary code and comments Pick-to: 6.5 Task-number: PYSIDE-1612 Change-Id: I5975d76024d6289fe6b9af1caeca374acb81e8cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/android')
-rw-r--r--sources/pyside-tools/deploy_lib/android/android_helper.py10
-rw-r--r--sources/pyside-tools/deploy_lib/android/buildozer.py14
2 files changed, 13 insertions, 11 deletions
diff --git a/sources/pyside-tools/deploy_lib/android/android_helper.py b/sources/pyside-tools/deploy_lib/android/android_helper.py
index b0c8254ab..b93fcdbdc 100644
--- a/sources/pyside-tools/deploy_lib/android/android_helper.py
+++ b/sources/pyside-tools/deploy_lib/android/android_helper.py
@@ -30,7 +30,7 @@ def create_recipe(version: str, component: str, wheel_path: str, generated_files
recipe_path = generated_files_path / "recipes" / f"{component}"
recipe_path.mkdir(parents=True, exist_ok=True)
- logging.info(f"Writing {component} recipe into {recipe_path}")
+ logging.info(f"[DEPLOY] Writing {component} recipe into {recipe_path}")
with open(recipe_path / "__init__.py", mode="w", encoding="utf-8") as recipe:
recipe.write(content)
@@ -38,7 +38,7 @@ def create_recipe(version: str, component: str, wheel_path: str, generated_files
def extract_and_copy_jar(wheel_path: Path, generated_files_path: Path) -> str:
'''
extracts the PySide6 wheel and copies the 'jar' folder to 'generated_files_path'.
- These .jar files are added to the buildozer.spec file to be later use by buildozer
+ These .jar files are added to the buildozer.spec file to be used later by buildozer
'''
jar_path = generated_files_path / "jar"
jar_path.mkdir(parents=True, exist_ok=True)
@@ -49,8 +49,10 @@ def extract_and_copy_jar(wheel_path: Path, generated_files_path: Path) -> str:
return jar_path
-def get_wheel_android_arch(wheel: str):
- wheel = Path(wheel)
+def get_wheel_android_arch(wheel: Path):
+ '''
+ Get android architecture from wheel
+ '''
supported_archs = ["aarch64", "armv7a", "i686", "x86_64"]
for arch in supported_archs:
if arch in wheel.stem:
diff --git a/sources/pyside-tools/deploy_lib/android/buildozer.py b/sources/pyside-tools/deploy_lib/android/buildozer.py
index 91d55f4ca..2ebd49d1a 100644
--- a/sources/pyside-tools/deploy_lib/android/buildozer.py
+++ b/sources/pyside-tools/deploy_lib/android/buildozer.py
@@ -7,8 +7,8 @@ from .. import run_command, BaseConfig, Config
class BuildozerConfig(BaseConfig):
- def __init__(self, buildozer_spec_file: Path, pysidedeploy_config: Config, dry_run: bool):
- super().__init__(buildozer_spec_file, dry_run, comment_prefixes="#")
+ def __init__(self, buildozer_spec_file: Path, pysidedeploy_config: Config):
+ super().__init__(buildozer_spec_file, comment_prefixes="#")
self.set_value("app", "title", pysidedeploy_config.title)
self.set_value("app", "package.name", pysidedeploy_config.title)
self.set_value("app", "package.domain",
@@ -16,7 +16,7 @@ class BuildozerConfig(BaseConfig):
include_exts = self.get_value("app", "source.include_exts")
include_exts = f"{include_exts},qml"
- self.set_value("app", "source.include_exts", include_exts)
+ self.set_value("app", "source.include_exts", include_exts, raise_warning=False)
self.set_value("app", "requirements", "python3,shiboken6,PySide6")
@@ -73,12 +73,12 @@ class Buildozer:
# creates buildozer.spec config file
command = ["buildozer", "init"]
run_command(command=command, dry_run=Buildozer.dry_run)
- if not Buildozer.dry_run and not buildozer_spec.exists():
- raise RuntimeError(f"buildozer.spec not found in {Path.cwd()}")
- BuildozerConfig(buildozer_spec, pysidedeploy_config, Buildozer.dry_run)
+ if not Buildozer.dry_run:
+ if not buildozer_spec.exists():
+ raise RuntimeError(f"buildozer.spec not found in {Path.cwd()}")
+ BuildozerConfig(buildozer_spec, pysidedeploy_config)
@staticmethod
def create_executable(mode: str):
- # build the application in release mode
command = ["buildozer", "android", mode]
run_command(command=command, dry_run=Buildozer.dry_run)