Skip to content

Commit

Permalink
feat: list-doc recognize android and wasm in all_os
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Jun 7, 2024
1 parent c7f516e commit 3ddcf71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions aqt/installer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018 Linus Jahn <[email protected]>
# Copyright (C) 2019-2021 Hiroshi Miura <[email protected]>
# Copyright (C) 2019-2024 Hiroshi Miura <[email protected]>
# Copyright (C) 2020, Aurélien Gâteau
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -804,7 +804,7 @@ def make_parser_sde(cmd: str, desc: str, is_legacy: bool, action, is_add_kde: bo

def make_parser_list_sde(cmd: str, desc: str, cmd_type: str):
parser = subparsers.add_parser(cmd, description=desc)
parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows", "all_os"], help="host os name")
parser.add_argument(
"qt_version_spec",
metavar="(VERSION | SPECIFICATION)",
Expand Down Expand Up @@ -852,12 +852,12 @@ def _make_list_qt_parser(self, subparsers: argparse._SubParsersAction):
"$ aqt list-qt mac desktop --archives 5.9.0 clang_64 # list archives in base Qt installation\n"
"$ aqt list-qt mac desktop --archives 5.14.0 clang_64 debug_info # list archives in debug_info module\n",
)
list_parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
list_parser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows", "all_os"], help="host os name")
list_parser.add_argument(
"target",
nargs="?",
default=None,
choices=["desktop", "winrt", "android", "ios"],
choices=["desktop", "winrt", "android", "ios", "qt", "wasm"],
help="Target SDK. When omitted, this prints all the targets available for a host OS.",
)
list_parser.add_argument(
Expand Down Expand Up @@ -1023,7 +1023,7 @@ def _set_common_arguments(self, subparser, *, is_legacy: bool, is_target_depreca
"""
if is_legacy:
subparser.add_argument("qt_version", help='Qt version in the format of "5.X.Y"')
subparser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows"], help="host os name")
subparser.add_argument("host", choices=["linux", "linux_arm64", "mac", "windows", "all_os"], help="host os name")
if is_target_deprecated:
subparser.add_argument(
"target",
Expand Down
6 changes: 5 additions & 1 deletion aqt/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ArchiveId:
"mac": ["android", "desktop", "ios"],
"linux": ["android", "desktop"],
"linux_arm64": ["desktop"],
"all_os": ["qt"],
"all_os": ["android", "qt", "wasm"],
}
EXTENSIONS_REQUIRED_ANDROID_QT6 = {"x86_64", "x86", "armv7", "arm64_v8a"}
ALL_EXTENSIONS = {"", "wasm", "src_doc_examples", *EXTENSIONS_REQUIRED_ANDROID_QT6}
Expand All @@ -231,6 +231,8 @@ def is_tools(self) -> bool:
return self.category == "tools"

def to_url(self) -> str:
if self.host == "all_os":
return "online/qtsdkrepository/{host}/{target}/".format(host=self.host, target=self.target)
return "online/qtsdkrepository/{os}{arch}/{target}/".format(
os=self.host,
arch=("_x86" if self.host == "windows" else ("" if self.host in ("linux_arm64", "all_os") else "_x64")),
Expand All @@ -256,6 +258,8 @@ def all_extensions(self, version: Version) -> List[str]:
return [""]

def __str__(self) -> str:
if self.host == "all_os":
return "{host}/{target}".format(host=self.host, target=self.target)
return "{cat}/{host}/{target}".format(
cat=self.category,
host=self.host,
Expand Down

0 comments on commit 3ddcf71

Please sign in to comment.