Unverified Commit 602f76ca authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

fix errors caught by roll of macOS assemble (#37351)

parent e1746161
......@@ -74,6 +74,14 @@ esac
build_inputs_path="${SOURCE_ROOT}/Flutter/ephemeral/FlutterInputs.xcfilelist"
build_outputs_path="${SOURCE_ROOT}/Flutter/ephemeral/FlutterOutputs.xcfilelist"
# Precache artifacts
RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
${verbose_flag} \
precache \
--no-android \
--no-ios \
--macos \
# TODO(jonahwilliams): support flavors https://github.com/flutter/flutter/issues/32923
RunCommand "${FLUTTER_ROOT}/bin/flutter" --suppress-analytics \
${verbose_flag} \
......
......@@ -43,6 +43,9 @@ List<File> listDartSources(Environment environment) {
final List<File> dartFiles = <File>[];
for (Uri uri in packageMap.values) {
final Directory libDirectory = fs.directory(uri.toFilePath(windows: platform.isWindows));
if (!libDirectory.existsSync()) {
continue;
}
for (FileSystemEntity entity in libDirectory.listSync(recursive: true)) {
if (entity is File && entity.path.endsWith('.dart')) {
dartFiles.add(entity);
......
......@@ -41,9 +41,6 @@ class UnpackMacOS extends Target {
List<Source> get outputs => const <Source>[
Source.pattern('$_kOutputPrefix/FlutterMacOS'),
// Headers
Source.pattern('$_kOutputPrefix/Headers/FLEOpenGLContextHandling.h'),
Source.pattern('$_kOutputPrefix/Headers/FLEReshapeListener.h'),
Source.pattern('$_kOutputPrefix/Headers/FLEView.h'),
Source.pattern('$_kOutputPrefix/Headers/FLEViewController.h'),
Source.pattern('$_kOutputPrefix/Headers/FlutterBinaryMessenger.h'),
Source.pattern('$_kOutputPrefix/Headers/FlutterChannels.h'),
......
......@@ -100,7 +100,7 @@ class MacOSDevice extends Device {
}
// Make sure to call stop app after we've built.
await stopApp(package);
await stopApp(prebuiltMacOSApp);
final Process process = await processManager.start(<String>[
prebuiltMacOSApp.executable,
]);
......
......@@ -251,6 +251,16 @@ flutter_tools:lib/''');
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
}));
test('list dart sources handles packages without lib directories', () => testbed.run(() {
fs.file('.packages')
..createSync()
..writeAsStringSync('''
# Generated
example:fiz/lib/''');
fs.directory('fiz').createSync();
expect(listDartSources(androidEnvironment), <File>[]);
}));
}
class MockProcessManager extends Mock implements ProcessManager {}
......
......@@ -86,9 +86,6 @@ void main() {
expect(fs.directory('macos/Flutter/ephemeral/FlutterMacOS.framework').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/FlutterMacOS').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FLEOpenGLContextHandling.h').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FLEReshapeListener.h').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FLEView.h').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FLEViewController.h').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FlutterBinaryMessenger.h').existsSync(), true);
expect(fs.file('macos/Flutter/ephemeral/FlutterMacOS.framework/Headers/FlutterChannels.h').existsSync(), true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment