Skip to content

Commit 56169b7

Browse files
committed
Stop looking for .packages when analyzing (flutter#150349)
Not sure exactly what this was supposed to do, but pub no longer writes ".packages" and has not done since: dart-lang/pub#3413. So this check would never find a '.packages'. Not sure if this code was doing anything useful - but it does not seem to have been missed for a couple of years. This is a warm-up for: flutter#150196 It was added in flutter#6093 seemingly without tests of this functionality.
1 parent b42c720 commit 56169b7

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

packages/flutter_tools/lib/src/commands/analyze_base.dart

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ class PackageDependency {
169169
}
170170

171171
class PackageDependencyTracker {
172-
/// Packages whose source is defined in the vended SDK.
173-
static const List<String> _vendedSdkPackages = <String>['analyzer', 'front_end', 'kernel'];
174-
175172
// This is a map from package names to objects that track the paths
176173
// involved (sources and targets).
177174
Map<String, PackageDependency> packages = <String, PackageDependency>{};
@@ -180,32 +177,6 @@ class PackageDependencyTracker {
180177
return packages.putIfAbsent(packageName, () => PackageDependency());
181178
}
182179

183-
/// Read the .packages file in [directory] and add referenced packages to [dependencies].
184-
void addDependenciesFromPackagesFileIn(Directory directory) {
185-
final String dotPackagesPath = globals.fs.path.join(directory.path, '.packages');
186-
final File dotPackages = globals.fs.file(dotPackagesPath);
187-
if (dotPackages.existsSync()) {
188-
// this directory has opinions about what we should be using
189-
final Iterable<String> lines = dotPackages
190-
.readAsStringSync()
191-
.split('\n')
192-
.where((String line) => !line.startsWith(RegExp(r'^ *#')));
193-
for (final String line in lines) {
194-
final int colon = line.indexOf(':');
195-
if (colon > 0) {
196-
final String packageName = line.substring(0, colon);
197-
final String packagePath = globals.fs.path.fromUri(line.substring(colon+1));
198-
// Ensure that we only add `analyzer` and dependent packages defined in the vended SDK (and referred to with a local
199-
// globals.fs.path. directive). Analyzer package versions reached via transitive dependencies (e.g., via `test`) are ignored
200-
// since they would produce spurious conflicts.
201-
if (!_vendedSdkPackages.contains(packageName) || packagePath.startsWith('..')) {
202-
add(packageName, globals.fs.path.normalize(globals.fs.path.absolute(directory.path, packagePath)), dotPackagesPath);
203-
}
204-
}
205-
}
206-
}
207-
}
208-
209180
void addCanonicalCase(String packageName, String packagePath, String pubSpecYamlPath) {
210181
getPackageDependency(packageName).addCanonicalCase(packagePath, pubSpecYamlPath);
211182
}
@@ -235,7 +206,6 @@ class PackageDependencyTracker {
235206
throwToolExit('pubspec.yaml is malformed.');
236207
}
237208
}
238-
dependencies.addDependenciesFromPackagesFileIn(directory);
239209
}
240210

241211
// prepare a union of all the .packages files

0 commit comments

Comments
 (0)