diff --git a/packages/flutter_tools/lib/src/commands/analyze_base.dart b/packages/flutter_tools/lib/src/commands/analyze_base.dart index 19377ff6b66..23872f31605 100644 --- a/packages/flutter_tools/lib/src/commands/analyze_base.dart +++ b/packages/flutter_tools/lib/src/commands/analyze_base.dart @@ -169,9 +169,6 @@ class PackageDependency { } class PackageDependencyTracker { - /// Packages whose source is defined in the vended SDK. - static const List _vendedSdkPackages = ['analyzer', 'front_end', 'kernel']; - // This is a map from package names to objects that track the paths // involved (sources and targets). Map packages = {}; @@ -180,32 +177,6 @@ class PackageDependencyTracker { return packages.putIfAbsent(packageName, () => PackageDependency()); } - /// Read the .packages file in [directory] and add referenced packages to [dependencies]. - void addDependenciesFromPackagesFileIn(Directory directory) { - final String dotPackagesPath = globals.fs.path.join(directory.path, '.packages'); - final File dotPackages = globals.fs.file(dotPackagesPath); - if (dotPackages.existsSync()) { - // this directory has opinions about what we should be using - final Iterable lines = dotPackages - .readAsStringSync() - .split('\n') - .where((String line) => !line.startsWith(RegExp(r'^ *#'))); - for (final String line in lines) { - final int colon = line.indexOf(':'); - if (colon > 0) { - final String packageName = line.substring(0, colon); - final String packagePath = globals.fs.path.fromUri(line.substring(colon+1)); - // Ensure that we only add `analyzer` and dependent packages defined in the vended SDK (and referred to with a local - // globals.fs.path. directive). Analyzer package versions reached via transitive dependencies (e.g., via `test`) are ignored - // since they would produce spurious conflicts. - if (!_vendedSdkPackages.contains(packageName) || packagePath.startsWith('..')) { - add(packageName, globals.fs.path.normalize(globals.fs.path.absolute(directory.path, packagePath)), dotPackagesPath); - } - } - } - } - } - void addCanonicalCase(String packageName, String packagePath, String pubSpecYamlPath) { getPackageDependency(packageName).addCanonicalCase(packagePath, pubSpecYamlPath); } @@ -235,7 +206,6 @@ class PackageDependencyTracker { throwToolExit('pubspec.yaml is malformed.'); } } - dependencies.addDependenciesFromPackagesFileIn(directory); } // prepare a union of all the .packages files