Add --frontend-server-starter-path option to flutter run and flutter test (#135038)

This commit is contained in:
Derek Xu
2023-09-21 14:32:35 -04:00
committed by GitHub
parent da1f801fd5
commit c627dbfbc6
18 changed files with 184 additions and 8 deletions

View File

@@ -123,6 +123,7 @@ BuildApp() {
"-dSplitDebugInfo=${SPLIT_DEBUG_INFO}"
"-dTrackWidgetCreation=${TRACK_WIDGET_CREATION}"
"-dAction=${ACTION}"
"-dFrontendServerStarterPath=${FRONTEND_SERVER_STARTER_PATH}"
"--DartDefines=${DART_DEFINES}"
"--ExtraGenSnapshotOptions=${EXTRA_GEN_SNAPSHOT_OPTIONS}"
"--ExtraFrontEndOptions=${EXTRA_FRONT_END_OPTIONS}"

View File

@@ -13,6 +13,7 @@ Future<void> main(List<String> arguments) async {
final String? dartDefines = Platform.environment['DART_DEFINES'];
final bool dartObfuscation = Platform.environment['DART_OBFUSCATION'] == 'true';
final String? frontendServerStarterPath = Platform.environment['FRONTEND_SERVER_STARTER_PATH'];
final String? extraFrontEndOptions = Platform.environment['EXTRA_FRONT_END_OPTIONS'];
final String? extraGenSnapshotOptions = Platform.environment['EXTRA_GEN_SNAPSHOT_OPTIONS'];
final String? flutterEngine = Platform.environment['FLUTTER_ENGINE'];
@@ -106,6 +107,8 @@ or
'--DartDefines=$dartDefines',
if (extraGenSnapshotOptions != null)
'--ExtraGenSnapshotOptions=$extraGenSnapshotOptions',
if (frontendServerStarterPath != null)
'-dFrontendServerStarterPath=$frontendServerStarterPath',
if (extraFrontEndOptions != null)
'--ExtraFrontEndOptions=$extraFrontEndOptions',
target,

View File

@@ -402,6 +402,7 @@ class Context {
'-dTrackWidgetCreation=${environment['TRACK_WIDGET_CREATION'] ?? ''}',
'-dDartObfuscation=${environment['DART_OBFUSCATION'] ?? ''}',
'-dAction=${environment['ACTION'] ?? ''}',
'-dFrontendServerStarterPath=${environment['FRONTEND_SERVER_STARTER_PATH'] ?? ''}',
'--ExtraGenSnapshotOptions=${environment['EXTRA_GEN_SNAPSHOT_OPTIONS'] ?? ''}',
'--DartDefines=${environment['DART_DEFINES'] ?? ''}',
'--ExtraFrontEndOptions=${environment['EXTRA_FRONT_END_OPTIONS'] ?? ''}',