feat: list-doc recognize android and wasm in all_os

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2024-06-07 11:25:51 +09:00
parent 649c55ed46
commit 4c69408d42
3 changed files with 18 additions and 14 deletions

View File

@@ -374,7 +374,7 @@ class QtArchives:
def _append_depends_tool(self, arch, tool_name):
os_target_folder = posixpath.join(
"online/qtsdkrepository",
self.os_name + ("_x86" if self.os_name == "windows" else ("" if self.os_name == "linux_arm64" else "_x64")),
self.os_name + ("_x86" if self.os_name == "windows" else ("" if self.os_name == "linux_arm64" or self.target == "wasm" else "_x64")),
self.target,
tool_name,
)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018 Linus Jahn <lnj@kaidan.im>
# Copyright (C) 2019-2021 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2019-2024 Hiroshi Miura <miurahr@linux.com>
# Copyright (C) 2020, Aurélien Gâteau
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -750,13 +750,13 @@ class Cli:
def _set_install_tool_parser(self, install_tool_parser, *, is_legacy: bool):
install_tool_parser.set_defaults(func=self.run_install_tool, is_legacy=is_legacy)
install_tool_parser.add_argument(
"host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64"], help="host os name"
"host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64", "all_os"], help="host os name"
)
if not is_legacy:
install_tool_parser.add_argument(
"target",
default=None,
choices=["desktop", "winrt", "android", "ios"],
choices=["wasm", "desktop", "winrt", "android", "ios"],
help="Target SDK.",
)
install_tool_parser.add_argument("tool_name", help="Name of tool such as tools_ifw, tools_mingw")
@@ -809,7 +809,7 @@ class Cli:
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", "windows_arm64"], help="host os name"
"host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64", "all_os"], help="host os name"
)
parser.add_argument(
"qt_version_spec",
@@ -859,13 +859,13 @@ class Cli:
"$ 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", "windows_arm64"], help="host os name"
"host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64", "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(
@@ -1034,18 +1034,18 @@ class Cli:
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", "windows_arm64"], help="host os name"
"host", choices=["linux", "linux_arm64", "mac", "windows", "windows_arm64", "all_os"], help="host os name"
)
if is_target_deprecated:
subparser.add_argument(
"target",
choices=["desktop", "winrt", "android", "ios"],
choices=["desktop", "winrt", "android", "ios", "wasm"],
nargs="?",
help="Ignored. This parameter is deprecated and marked for removal in a future release. "
"It is present here for backwards compatibility.",
)
else:
subparser.add_argument("target", choices=["desktop", "winrt", "android", "ios"], help="target sdk")
subparser.add_argument("target", choices=["desktop", "winrt", "android", "ios", "wasm"], help="target sdk")
if not is_legacy:
subparser.add_argument(
"qt_version_spec",
@@ -1114,7 +1114,7 @@ class Cli:
self.logger.info(f"Found installed {host}-desktop Qt at {installed_desktop_arch_dir}")
return installed_desktop_arch_dir.name, None
default_desktop_arch = MetadataFactory(ArchiveId("qt", host, "desktop")).fetch_default_desktop_arch(version, is_msvc)
default_desktop_arch = MetadataFactory(ArchiveId("qt", host, "desktop")).fetch_default_desktop_arch(version, is_msvc, is_wasm)
desktop_arch_dir = QtRepoProperty.get_arch_dir_name(host, default_desktop_arch, version)
expected_desktop_arch_path = base_path / dir_for_version(version) / desktop_arch_dir

View File

@@ -206,7 +206,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}
@@ -232,6 +232,8 @@ class ArchiveId:
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=(
@@ -269,6 +271,8 @@ class ArchiveId:
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,
@@ -950,9 +954,9 @@ class MetadataFactory:
return str(self.archive_id)
return "{} with spec {}".format(self.archive_id, self.spec)
def fetch_default_desktop_arch(self, version: Version, is_msvc: bool = False) -> str:
def fetch_default_desktop_arch(self, version: Version, is_msvc: bool = False, is_wasm: bool = False) -> str:
assert self.archive_id.target == "desktop", "This function is meant to fetch desktop architectures"
if self.archive_id.host == "linux":
if self.archive_id.host == "linux" or is_wasm:
if version >= Version("6.7.0"):
return "linux_gcc_64"
else: