mirror of
https://github.com/flutter/flutter.git
synced 2026-02-13 22:31:34 +08:00
commit
d3dbc07f50
@ -95,10 +95,13 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
|
||||
// .../packages/*/bin/*.dart
|
||||
// .../packages/*/lib/main.dart
|
||||
// .../packages/*/test/*_test.dart
|
||||
// .../packages/*/test/*/*_test.dart
|
||||
Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages'));
|
||||
for (FileSystemEntity entry in packages.listSync()) {
|
||||
if (entry is Directory) {
|
||||
bool foundOne = false;
|
||||
|
||||
Directory binDirectory = new Directory(path.join(entry.path, 'bin'));
|
||||
if (binDirectory.existsSync()) {
|
||||
for (FileSystemEntity subentry in binDirectory.listSync()) {
|
||||
@ -108,11 +111,30 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String mainPath = path.join(entry.path, 'lib', 'main.dart');
|
||||
if (FileSystemEntity.isFileSync(mainPath)) {
|
||||
dartFiles.add(mainPath);
|
||||
foundOne = true;
|
||||
}
|
||||
|
||||
Directory testDirectory = new Directory(path.join(entry.path, 'test'));
|
||||
if (testDirectory.existsSync()) {
|
||||
for (FileSystemEntity entry in testDirectory.listSync()) {
|
||||
if (entry is Directory) {
|
||||
for (FileSystemEntity subentry in entry.listSync()) {
|
||||
if (subentry is File && subentry.path.endsWith('_test.dart')) {
|
||||
dartFiles.add(subentry.path);
|
||||
foundTest = true;
|
||||
}
|
||||
}
|
||||
} else if (entry is File && entry.path.endsWith('_test.dart')) {
|
||||
dartFiles.add(entry.path);
|
||||
foundTest = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundOne)
|
||||
pubSpecDirectories.add(entry.path);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user