[flutter_tools] handle out of date xcode config in assemble (#79983)
This commit is contained in:
@@ -291,7 +291,15 @@ class AssembleCommand extends FlutterCommand {
|
||||
}
|
||||
}
|
||||
Target target;
|
||||
final List<String> decodedDefines = decodeDartDefines(environment.defines, kDartDefines);
|
||||
List<String> decodedDefines;
|
||||
try {
|
||||
decodedDefines = decodeDartDefines(environment.defines, kDartDefines);
|
||||
} on FormatException {
|
||||
throwToolExit(
|
||||
'Error parsing assemble command: your generated configuration may be out of date. '
|
||||
"Try re-running 'flutter build ios' or the appropriate build command."
|
||||
);
|
||||
}
|
||||
if (FlutterProject.current().manifest.deferredComponents != null
|
||||
&& decodedDefines.contains('validate-deferred-components=true')
|
||||
&& deferredTargets.isNotEmpty
|
||||
|
||||
@@ -99,6 +99,28 @@ void main() {
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('flutter assemble throws ToolExit if dart-defines are not base64 encoded', () async {
|
||||
final CommandRunner<void> commandRunner = createTestCommandRunner(AssembleCommand(
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
|
||||
));
|
||||
|
||||
final List<String> command = <String>[
|
||||
'assemble',
|
||||
'--output',
|
||||
'Output',
|
||||
'--DartDefines=flutter.inspector.structuredErrors%3Dtrue',
|
||||
'debug_macos_bundle_flutter_assets',
|
||||
];
|
||||
expect(
|
||||
commandRunner.run(command),
|
||||
throwsToolExit(message: 'Error parsing assemble command: your generated configuration may be out of date')
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache.test(processManager: FakeProcessManager.any()),
|
||||
FileSystem: () => MemoryFileSystem.test(),
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('flutter assemble throws ToolExit if called with non-existent rule', () async {
|
||||
final CommandRunner<void> commandRunner = createTestCommandRunner(AssembleCommand(
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
|
||||
|
||||
Reference in New Issue
Block a user