Files
cutdex/tool/build.py
lingjhf 4a759d81a6
Gitea CI / Check code and tests (push) Successful in 7m38s
Gitea CI / Build Android APK (push) Successful in 6m20s
Gitea CI / Audit and package Windows x64 (push) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (push) Canceled after 0s
Gitea CI / Gitea CI passed (push) Canceled after 0s
Gitea CI / Build Windows x64 app (push) Canceled after 14m42s
refactor(build): 统一本地与 CI 构建入口及平台发布工具 (#9)
2026-10-06 16:14:42 +00:00

28 lines
1.2 KiB
Python

"""Build the application with shared development/production presets."""
import argparse
import sys
from common.build import build_application
from common.process import cli
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('platform', choices=['android', 'windows', 'macos'])
parser.add_argument('--flavor', choices=['development', 'production'], default='production')
parser.add_argument('--mode', choices=['debug', 'profile', 'release'], default='release')
parser.add_argument('--split-per-abi', action='store_true')
# Explicit separator keeps custom Flutter arguments distinct from presets.
arguments = sys.argv[1:]
separator = arguments.index('--') if '--' in arguments else len(arguments)
extra = arguments[separator + 1:]
args = parser.parse_args(arguments[:separator])
if args.split_per_abi and args.platform != 'android':
parser.error('--split-per-abi is only available for Android')
return build_application(args.platform, flavor=args.flavor, mode=args.mode,
split_per_abi=args.split_per_abi, extra=extra).returncode
if __name__ == '__main__':
sys.exit(cli(main))