Unverified Commit 71740bef authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

remove listDartSources (#43950)

parent 7d4a968f
......@@ -8,10 +8,8 @@ import '../../artifacts.dart';
import '../../asset.dart';
import '../../base/build.dart';
import '../../base/file_system.dart';
import '../../base/platform.dart';
import '../../build_info.dart';
import '../../compile.dart';
import '../../dart/package_map.dart';
import '../../devfs.dart';
import '../../globals.dart';
import '../../project.dart';
......@@ -42,27 +40,6 @@ const String kTrackWidgetCreation = 'TrackWidgetCreation';
/// The other supported value is armv7, the 32-bit iOS architecture.
const String kIosArchs = 'IosArchs';
/// Finds the locations of all dart files within the project.
///
/// This does not attempt to determine if a file is used or imported, so it
/// may otherwise report more files than strictly necessary.
List<File> listDartSources(Environment environment) {
final Map<String, Uri> packageMap = PackageMap(environment.projectDir.childFile('.packages').path).map;
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);
}
}
}
return dartFiles;
}
/// Copies the prebuilt flutter bundle.
// This is a one-off rule for implementing build bundle in terms of assemble.
class CopyFlutterBundle extends Target {
......
......@@ -354,16 +354,6 @@ flutter_tools:lib/''');
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>[]);
}));
test('Profile/ReleaseCopyFlutterAotBundle copies .so to correct output directory', () => testbed.run(() async {
androidEnvironment.buildDir.createSync(recursive: true);
androidEnvironment.buildDir.childFile('app.so').createSync();
......
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