refactor(build): 统一本地与 CI 构建入口及平台发布工具 (#9)
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
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
This commit was merged in pull request #9.
This commit is contained in:
1 parent
a13a54d5ec
commit
4a759d81a6
61 files changed
+1913
-388
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""Application build presets shared by CLI and platform release workflows."""
|
||||
from common.process import ROOT
|
||||
from project_tools import run_tool
|
||||
|
||||
|
||||
def build_arguments(platform, *, flavor='production', mode='release', split_per_abi=False):
|
||||
target = 'apk' if platform == 'android' else platform
|
||||
arguments = ['build', target, f'--{mode}', '--flavor', flavor]
|
||||
if platform == 'android':
|
||||
arguments += ['--target-platform', 'android-arm64,android-x64']
|
||||
if split_per_abi:
|
||||
arguments.append('--split-per-abi')
|
||||
if platform == 'macos':
|
||||
arguments.append('--split-debug-info=build/symbols/macos')
|
||||
return arguments
|
||||
|
||||
|
||||
def build_application(platform, *, flavor='production', mode='release',
|
||||
split_per_abi=False, extra=(), environment=None, root=ROOT, cwd=None):
|
||||
"""Use root's SDK/configuration; an isolated build may override cwd."""
|
||||
return run_tool('flutter', build_arguments(
|
||||
platform, flavor=flavor, mode=mode, split_per_abi=split_per_abi) + list(extra),
|
||||
root=root, cwd=cwd, env=environment, check=True)
|
||||
Reference in new issue
Block a user