From fc2d4a45cab1fa1f6b92e634afddd01093a54131 Mon Sep 17 00:00:00 2001 From: Semyon Bezrukov Date: Tue, 6 Jun 2023 12:48:37 +0300 Subject: [PATCH] Package scripts fix (#688) --- make_package.py | 2 +- scripts/package_builder.py | 2 +- scripts/package_common.py | 36 +++++++++++++++++++++++++----------- scripts/package_core.py | 2 +- scripts/package_utils.py | 2 +- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/make_package.py b/make_package.py index 9c6f2de..9b48a8f 100755 --- a/make_package.py +++ b/make_package.py @@ -25,7 +25,7 @@ args = parser.parse_args() common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..") common.os_family = utils.host_platform() common.platform = args.platform -common.prefix = common.platforms[common.platform]["prefix"] +common.prefix = common.platformPrefixes[common.platform] if hasattr(common.platformPrefixes, common.platform) else "" common.targets = args.targets common.clean = "clean" in args.targets common.sign = "sign" in args.targets diff --git a/scripts/package_builder.py b/scripts/package_builder.py index 6af6434..b05dcc2 100644 --- a/scripts/package_builder.py +++ b/scripts/package_builder.py @@ -44,7 +44,7 @@ def make_windows(): global inno_file, zip_file, suffix, key_prefix utils.set_cwd("document-builder-package") - prefix = common.platforms[common.platform]["prefix"] + prefix = common.platformPrefixes[common.platform] company = branding.company_name product = branding.builder_product_name.replace(" ","") source_dir = "..\\build_tools\\out\\%s\\%s\\%s" % (prefix, company, product) diff --git a/scripts/package_common.py b/scripts/package_common.py index 96e13fd..e71e223 100644 --- a/scripts/package_common.py +++ b/scripts/package_common.py @@ -1,16 +1,30 @@ #!/usr/bin/env python -platforms = { - "windows_x64": { "title": "Windows x64", "prefix": "win_64" }, - "windows_x64_xp": { "title": "Windows x64 XP", "prefix": "win_64_xp" }, - "windows_x86": { "title": "Windows x86", "prefix": "win_32" }, - "windows_x86_xp": { "title": "Windows x86 XP", "prefix": "win_32_xp" }, - "darwin_x86_64": { "title": "macOS x86_64", "prefix": "mac_64" }, - "darwin_x86_64_v8": { "title": "macOS x86_64 V8", "prefix": "mac_64" }, - "darwin_arm64": { "title": "macOS arm64", "prefix": "mac_arm64" }, - "linux_x86_64": { "title": "Linux x86_64", "prefix": "linux_64" }, - "linux_aarch64": { "title": "Linux aarch64", "prefix": "linux_arm64" }, - "android": { "title": "Android" } +platformTitles = { + "windows_x64": "Windows x64", + "windows_x86": "Windows x86", + "windows_x64_xp": "Windows x64 XP", + "windows_x86_xp": "Windows x86 XP", + "darwin_x86_64": "macOS x86_64", + "darwin_arm64": "macOS arm64", + "darwin_x86_64_v8": "macOS x86_64 V8", + "linux_x86_64": "Linux x86_64", + "linux_aarch64": "Linux aarch64", + "linux_x86_64_cef": "Linux x86_64 cef107", + "android": "Android", +} + +platformPrefixes = { + "windows_x64": "win_64", + "windows_x86": "win_32", + "windows_x64_xp": "win_64_xp", + "windows_x86_xp": "win_32_xp", + "darwin_x86_64": "mac_64", + "darwin_arm64": "mac_arm64", + "darwin_x86_64_v8": "mac_64", + "linux_x86_64": "linux_64", + "linux_aarch64": "linux_arm64", + "linux_x86_64_cef": "linux_64", } out_dir = "build_tools/out" diff --git a/scripts/package_core.py b/scripts/package_core.py index dfce8e5..d560711 100644 --- a/scripts/package_core.py +++ b/scripts/package_core.py @@ -14,7 +14,7 @@ def make(): return def make_core(): - prefix = common.platforms[common.platform]["prefix"] + prefix = common.platformPrefixes[common.platform] company = branding.company_name.lower() repos = { "windows_x64": { "repo": "windows", "arch": "x64", "version": common.version + "." + common.build }, diff --git a/scripts/package_utils.py b/scripts/package_utils.py index ad0f126..ab18c58 100644 --- a/scripts/package_utils.py +++ b/scripts/package_utils.py @@ -260,7 +260,7 @@ def set_summary(target, status): def add_deploy_data(product, ptype, src, dst): common.deploy_data.append({ - "platform": common.platforms[common.platform]["title"], + "platform": common.platformTitles[common.platform], "product": product, "type": ptype, # "local": get_path(src),