refactor(build): unify SDK configuration and release tooling

Pin Flutter with FVM and share local environment loading across IDE, Python, and Dart entrypoints. Keep CI on the verified preinstalled SDK and skip local overrides.

Extract common build presets, process execution, and file hashing. Propagate project roots through SDK selection and release commands, and migrate macOS release, signing, and DMG orchestration to Python.

Reuse local check suites in CI, support Android source overrides, and update documentation and regression tests.
This commit is contained in:
lingjhf committed 2026-10-06 23:34:15 +08:00
1 parent a13a54d5ec
commit 0343e2f723
57 files changed
+1858 -375

No files matched your search

+7 -5
View File
@@ -15,6 +15,9 @@ import sys
import threading
import time
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from project_tools import project_environment, tool_command
from windows_updates import ROOT, check_tool, pack_release, resolved_deskup, update_version, verify_sdk_version, vpk_command
@@ -38,7 +41,6 @@ class TestHandler(SimpleHTTPRequestHandler):
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--vpk', type=Path, required=True)
parser.add_argument('--flutter', default=shutil.which('flutter'))
parser.add_argument('--work', type=Path, default=ROOT / '.local/windows-update-test')
parser.add_argument('--port', type=int, default=8765)
parser.add_argument('--offline', action='store_true', help='Use already cached Flutter packages')
@@ -56,7 +58,7 @@ def main():
definitions = work / 'defines.json'
definitions.write_text(json.dumps({'CUTDEX_UPDATE_SMOKE_ROOT': work.as_posix(),
'CUTDEX_WINDOWS_UPDATE_URL': f'http://127.0.0.1:{args.port}'}), encoding='utf-8')
environment = dict(os.environ)
environment = project_environment()
# Isolate Flutter caches, generated runner files and output from live builds.
source = work / 'source'
source.mkdir()
@@ -74,13 +76,13 @@ def main():
entry = source / 'tool/testing/windows_update_smoke.dart'
entry.parent.mkdir(parents=True)
shutil.copyfile(ROOT / 'tool/testing/windows_update_smoke.dart', entry)
subprocess.run([args.flutter, 'pub', 'get'] + (['--offline'] if args.offline else []),
subprocess.run(tool_command('flutter', ['pub', 'get'] + (['--offline'] if args.offline else []), cwd=source),
cwd=source, env=environment, check=True)
# Keep test packages separate from the app's normal release output.
for build in [900001, 900002]:
subprocess.run([args.flutter, 'build', 'windows', '--no-pub', '--release', '--flavor', 'development',
subprocess.run(tool_command('flutter', ['build', 'windows', '--no-pub', '--release', '--flavor', 'development',
'--target', 'tool/testing/windows_update_smoke.dart', '--build-name', '1.0.0',
'--build-number', str(build), '--dart-define-from-file', str(definitions)],
'--build-number', str(build), '--dart-define-from-file', str(definitions)], cwd=source),
cwd=source, env=environment, check=True)
app = source / 'build/windows/x64/development/runner/Release'
release = work / ('baseline' if build == 900001 else 'public')