Discontinue .packages file

Contributes to https://github.com/dart-lang/sdk/issues/48275

Change-Id: I3acb90b91b9b206b69ca0ae311aa43f5954c29a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243625
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
This commit is contained in:
Michael Thomsen 2022-05-11 08:50:45 +00:00 committed by Commit Bot
parent 4258a59789
commit 0baa3c1e62
2 changed files with 1 additions and 23 deletions

View file

@ -171,7 +171,7 @@ class TestConfiguration {
String _packages;
String get packages {
// If the .packages file path wasn't given, find it.
// If the package config file path wasn't given, find it.
_packages ??=
Repository.uri.resolve('.dart_tool/package_config.json').toFilePath();

View file

@ -113,28 +113,6 @@ void main(List<String> args) {
},
);
writeIfDifferent(configFile, packageConfig.generateJson('..'));
// Also generate the repo's .packages file.
var packagesFile = File(join(repoRoot, '.packages'));
var buffer = StringBuffer('''
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# This file is generated; do not edit. To re-generate, run:
# 'dart tools/generate_package_config.dart'.
''');
for (var package in packages) {
final name = package.name;
final rootUri = package.rootUri;
final packageUri = package.packageUri;
if (packageUri != null && packageUri != '.nonexisting') {
buffer.writeln('$name:${posix(rootUri)}/${posix(packageUri)}');
}
}
writeIfDifferent(packagesFile, buffer.toString());
}
/// Writes the given [contents] string to [file] if the contents are different