diff --git a/pkg/compiler/test/end_to_end/dill_loader_test.dart b/pkg/compiler/test/end_to_end/dill_loader_test.dart index fe24e883fb8..8cfe81aee43 100644 --- a/pkg/compiler/test/end_to_end/dill_loader_test.dart +++ b/pkg/compiler/test/end_to_end/dill_loader_test.dart @@ -28,7 +28,7 @@ main() { var options = CompilerOptions() ..target = Dart2jsTarget("dart2js", TargetFlags(enableNullSafety: true)) ..nnbdMode = NnbdMode.Strong - ..packagesFileUri = Uri.base.resolve('.packages') + ..packagesFileUri = Uri.base.resolve('.dart_tool/package_config.json') ..additionalDills = [ computePlatformBinariesLocation().resolve("dart2js_platform.dill"), ] diff --git a/pkg/compiler/test/end_to_end/no_platform_test.dart b/pkg/compiler/test/end_to_end/no_platform_test.dart index e786f3f8cc3..349b129e37e 100644 --- a/pkg/compiler/test/end_to_end/no_platform_test.dart +++ b/pkg/compiler/test/end_to_end/no_platform_test.dart @@ -22,7 +22,8 @@ main() { new Dart2jsTarget('dart2js', new TargetFlags()), sdkLibrariesSpecificationUri, [], // additionalDills - Uri.base.resolve('.packages'), // packagesFileUri + Uri.base + .resolve('.dart_tool/package_config.json'), // packagesFileUri explicitExperimentalFlags: experimentalFlags, verify: true); ir.Component component = await fe.compile( diff --git a/pkg/compiler/test/helpers/memory_compiler.dart b/pkg/compiler/test/helpers/memory_compiler.dart index 04ec18ce269..310120af8cf 100644 --- a/pkg/compiler/test/helpers/memory_compiler.dart +++ b/pkg/compiler/test/helpers/memory_compiler.dart @@ -133,8 +133,8 @@ Compiler compilerFor( packageConfig = Uri.base.resolve(Platform.packageConfig); } else { // The tests are run with the base directory as the SDK root - // so just use the .packages file there. - packageConfig = Uri.base.resolve('.packages'); + // so just use the package config there. + packageConfig = Uri.base.resolve('.dart_tool/package_config.json'); } } diff --git a/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart b/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart index ea96e196e7d..e75d3d00e41 100644 --- a/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart +++ b/pkg/dev_compiler/test/sourcemap/sourcemaps_ddk_suite.dart @@ -59,8 +59,10 @@ class DevCompilerRunner implements CompilerRunner { var ddcSdkSummary = findInOutDir('ddc_outline.dill'); + var packageConfigPath = + sdkRoot.uri.resolve('.dart_tool/package_config.json').toFilePath(); var args = [ - "--packages=${sdkRoot.uri.resolve(".packages").toFilePath()}", + '--packages=$packageConfigPath', '--modules=es6', '--dart-sdk-summary=${ddcSdkSummary.path}', '-o', diff --git a/pkg/front_end/test/async_but_no_await_git_test.dart b/pkg/front_end/test/async_but_no_await_git_test.dart index 6721ee120f2..fb27bc24d74 100644 --- a/pkg/front_end/test/async_but_no_await_git_test.dart +++ b/pkg/front_end/test/async_but_no_await_git_test.dart @@ -31,11 +31,11 @@ Set libUris = {}; Future main(List args) async { api.CompilerOptions compilerOptions = getOptions(); - Uri dotPackagesUri = repoDir.resolve(".packages"); - if (!new File.fromUri(dotPackagesUri).existsSync()) { + Uri packageConfigUri = repoDir.resolve(".dart_tool/package_config.json"); + if (!new File.fromUri(packageConfigUri).existsSync()) { throw "Couldn't find .packages"; } - compilerOptions.packagesFileUri = dotPackagesUri; + compilerOptions.packagesFileUri = packageConfigUri; ProcessedOptions options = new ProcessedOptions(options: compilerOptions); diff --git a/pkg/front_end/test/comments_on_certain_arguments_tool.dart b/pkg/front_end/test/comments_on_certain_arguments_tool.dart index 3607cc250d9..c588afcf187 100644 --- a/pkg/front_end/test/comments_on_certain_arguments_tool.dart +++ b/pkg/front_end/test/comments_on_certain_arguments_tool.dart @@ -61,11 +61,11 @@ late Component component; Future main(List args) async { api.CompilerOptions compilerOptions = getOptions(); - Uri dotPackagesUri = repoDir.resolve(".packages"); - if (!new File.fromUri(dotPackagesUri).existsSync()) { - throw "Couldn't find .packages"; + Uri packageConfigUri = repoDir.resolve(".dart_tool/package_config.json"); + if (!new File.fromUri(packageConfigUri).existsSync()) { + throw "Couldn't find .dart_tool/package_config.json"; } - compilerOptions.packagesFileUri = dotPackagesUri; + compilerOptions.packagesFileUri = packageConfigUri; ProcessedOptions options = new ProcessedOptions(options: compilerOptions); diff --git a/pkg/front_end/test/deps_git_test.dart b/pkg/front_end/test/deps_git_test.dart index 201735214aa..e123def944f 100644 --- a/pkg/front_end/test/deps_git_test.dart +++ b/pkg/front_end/test/deps_git_test.dart @@ -49,11 +49,11 @@ Future main() async { Ticker ticker = new Ticker(isVerbose: false); CompilerOptions compilerOptions = getOptions(); - Uri dotPackagesUri = repoDir.resolve(".packages"); - if (!new File.fromUri(dotPackagesUri).existsSync()) { - throw "Couldn't find .packages"; + Uri packageConfigUri = repoDir.resolve(".dart_tool/package_config.json"); + if (!new File.fromUri(packageConfigUri).existsSync()) { + throw "Couldn't find .dart_tool/package_config.json"; } - compilerOptions.packagesFileUri = dotPackagesUri; + compilerOptions.packagesFileUri = packageConfigUri; ProcessedOptions options = new ProcessedOptions(options: compilerOptions); @@ -123,7 +123,7 @@ Future main() async { // * Everything else is an error. // Remove white-listed non-dart files. - otherNonDartUris.remove(dotPackagesUri); + otherNonDartUris.remove(packageConfigUri); otherNonDartUris.remove(repoDir.resolve("sdk/lib/libraries.json")); otherNonDartUris.remove(repoDir.resolve(".dart_tool/package_config.json")); diff --git a/pkg/front_end/test/explicit_creation_git_test.dart b/pkg/front_end/test/explicit_creation_git_test.dart index 3200635d4c1..9a6676c254a 100644 --- a/pkg/front_end/test/explicit_creation_git_test.dart +++ b/pkg/front_end/test/explicit_creation_git_test.dart @@ -49,11 +49,11 @@ Future main(List args) async { Ticker ticker = new Ticker(isVerbose: false); api.CompilerOptions compilerOptions = getOptions(); - Uri dotPackagesUri = repoDir.resolve(".packages"); - if (!new File.fromUri(dotPackagesUri).existsSync()) { - throw "Couldn't find .packages"; + Uri packageConfigUri = repoDir.resolve(".dart_tool/package_config.json"); + if (!new File.fromUri(packageConfigUri).existsSync()) { + throw "Couldn't find .dart_tool/package_config.json"; } - compilerOptions.packagesFileUri = dotPackagesUri; + compilerOptions.packagesFileUri = packageConfigUri; ProcessedOptions options = new ProcessedOptions(options: compilerOptions); diff --git a/pkg/front_end/test/fasta/incremental_hello_test.dart b/pkg/front_end/test/fasta/incremental_hello_test.dart index 125ef123406..6a6daac4b3a 100644 --- a/pkg/front_end/test/fasta/incremental_hello_test.dart +++ b/pkg/front_end/test/fasta/incremental_hello_test.dart @@ -37,7 +37,7 @@ void diagnosticMessageHandler(DiagnosticMessage message) { Future test({required bool sdkFromSource}) async { final CompilerOptions optionBuilder = new CompilerOptions() - ..packagesFileUri = Uri.base.resolve(".packages") + ..packagesFileUri = Uri.base.resolve(".dart_tool/package_config.json") ..target = new VmTarget(new TargetFlags()) ..omitPlatform = true ..onDiagnostic = diagnosticMessageHandler diff --git a/pkg/front_end/test/fasta/testing/suite.dart b/pkg/front_end/test/fasta/testing/suite.dart index 65269ddfeda..bbbcbc6bc8b 100644 --- a/pkg/front_end/test/fasta/testing/suite.dart +++ b/pkg/front_end/test/fasta/testing/suite.dart @@ -537,7 +537,7 @@ class FastaContext extends ChainContext with MatchContext { UriTranslator? uriTranslator = _uriTranslators[uriConfiguration]; if (uriTranslator == null) { Uri sdk = Uri.base.resolve("sdk/"); - Uri packages = Uri.base.resolve(".packages"); + Uri packages = Uri.base.resolve(".dart_tool/package_config.json"); FolderOptions folderOptions = computeFolderOptions(description); CompilerOptions compilerOptions = new CompilerOptions() ..onDiagnostic = (DiagnosticMessage message) { diff --git a/pkg/front_end/test/fasta/types/dill_hierarchy_test.dart b/pkg/front_end/test/fasta/types/dill_hierarchy_test.dart index a1c2094c847..193d73477ad 100644 --- a/pkg/front_end/test/fasta/types/dill_hierarchy_test.dart +++ b/pkg/front_end/test/fasta/types/dill_hierarchy_test.dart @@ -86,7 +86,8 @@ class F implements D;""", final CompilerContext context = new CompilerContext(new ProcessedOptions( options: new CompilerOptions() - ..packagesFileUri = Uri.base.resolve(".packages"))); + ..packagesFileUri = + Uri.base.resolve(".dart_tool/package_config.json"))); asyncTest(() => context.runInContext((_) async { DillTarget target = new DillTarget( diff --git a/pkg/front_end/test/fasta/types/fasta_legacy_upper_bound_test.dart b/pkg/front_end/test/fasta/types/fasta_legacy_upper_bound_test.dart index 618c014f589..e4466af4002 100644 --- a/pkg/front_end/test/fasta/types/fasta_legacy_upper_bound_test.dart +++ b/pkg/front_end/test/fasta/types/fasta_legacy_upper_bound_test.dart @@ -66,7 +66,8 @@ void main() { final Ticker ticker = new Ticker(); final CompilerContext context = new CompilerContext(new ProcessedOptions( options: new CompilerOptions() - ..packagesFileUri = Uri.base.resolve(".packages"))); + ..packagesFileUri = + Uri.base.resolve(".dart_tool/package_config.json"))); context.runInContext( (_) => new FastaLegacyUpperBoundTest(ticker, context).test()); } diff --git a/pkg/front_end/test/fasta/types/fasta_types_test.dart b/pkg/front_end/test/fasta/types/fasta_types_test.dart index 55095c733a2..efbfacc160d 100644 --- a/pkg/front_end/test/fasta/types/fasta_types_test.dart +++ b/pkg/front_end/test/fasta/types/fasta_types_test.dart @@ -42,7 +42,8 @@ void main() { final Ticker ticker = new Ticker(isVerbose: false); final CompilerContext context = new CompilerContext(new ProcessedOptions( options: new CompilerOptions() - ..packagesFileUri = Uri.base.resolve(".packages"))); + ..packagesFileUri = + Uri.base.resolve(".dart_tool/package_config.json"))); final Uri uri = Uri.parse("dart:core"); final TypeParserEnvironment environment = new TypeParserEnvironment(uri, uri); final Component sdk = parseSdk(uri, environment); diff --git a/pkg/front_end/test/fasta/types/subtypes_benchmark.dart b/pkg/front_end/test/fasta/types/subtypes_benchmark.dart index 165313e03a1..d1f142842d1 100644 --- a/pkg/front_end/test/fasta/types/subtypes_benchmark.dart +++ b/pkg/front_end/test/fasta/types/subtypes_benchmark.dart @@ -138,7 +138,8 @@ Future run(Uri benchmarkInput, String name) async { final CompilerContext context = new CompilerContext(new ProcessedOptions( options: new CompilerOptions() - ..packagesFileUri = Uri.base.resolve(".packages"))); + ..packagesFileUri = + Uri.base.resolve(".dart_tool/package_config.json"))); await context.runInContext((_) async { DillTarget target = new DillTarget( ticker, diff --git a/pkg/front_end/test/outline_extractor_suite.dart b/pkg/front_end/test/outline_extractor_suite.dart index 80754c77842..02be7f579f9 100644 --- a/pkg/front_end/test/outline_extractor_suite.dart +++ b/pkg/front_end/test/outline_extractor_suite.dart @@ -100,7 +100,7 @@ class OutlineExtractorStep @override Future> run( TestDescription description, Context context) async { - Uri? packages = description.uri.resolve(".packages"); + Uri? packages = description.uri.resolve(".dart_tool/package_config.json"); if (!new File.fromUri(packages).existsSync()) { packages = null; } @@ -142,7 +142,7 @@ class CompileAndCompareStep @override Future> run( TestDescription description, Context context) async { - Uri? packages = description.uri.resolve(".packages"); + Uri? packages = description.uri.resolve(".dart_tool/package_config.json"); if (!new File.fromUri(packages).existsSync()) { packages = null; } diff --git a/pkg/front_end/test/outline_extractor_tester.dart b/pkg/front_end/test/outline_extractor_tester.dart index 941b5c08d42..01fbca9ccf6 100644 --- a/pkg/front_end/test/outline_extractor_tester.dart +++ b/pkg/front_end/test/outline_extractor_tester.dart @@ -18,7 +18,7 @@ import 'package:package_config/package_config.dart'; Future main(List args) async { if (args.length != 1) throw "Wants 1 argument."; Uri input = Uri.base.resolve(args.single); - Uri packageUri = input.resolve(".packages"); + Uri packageUri = input.resolve(".dart_tool/package_config.json"); Stopwatch stopwatch = new Stopwatch()..start(); PackageConfig packageFile = await loadPackageConfigUri(packageUri); print("Read packages file in ${stopwatch.elapsedMilliseconds} ms"); diff --git a/pkg/front_end/test/packages_format_error_test.dart b/pkg/front_end/test/packages_format_error_test.dart index a19551ff6c0..593e1bd3a03 100644 --- a/pkg/front_end/test/packages_format_error_test.dart +++ b/pkg/front_end/test/packages_format_error_test.dart @@ -26,7 +26,7 @@ import 'package:front_end/src/fasta/messages.dart' void main() { Uri root = Uri.parse("org-dartlang-test:///"); MemoryFileSystem fs = new MemoryFileSystem(root); - Uri packages = root.resolve(".packages"); + Uri packages = root.resolve(".dart_tool/package_config.json"); fs.entityForUri(packages).writeAsStringSync("bad\n"); List messages = []; CompilerContext c = new CompilerContext(new ProcessedOptions( diff --git a/pkg/front_end/test/parts/parts_test.dart b/pkg/front_end/test/parts/parts_test.dart index 9bfe8fff72c..3e42c006869 100644 --- a/pkg/front_end/test/parts/parts_test.dart +++ b/pkg/front_end/test/parts/parts_test.dart @@ -13,7 +13,7 @@ Future main() async { Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); CompilerOptions options = new CompilerOptions() ..sdkRoot = computePlatformBinariesLocation() - ..packagesFileUri = Uri.base.resolve('.packages'); + ..packagesFileUri = Uri.base.resolve('.dart_tool/package_config.json'); for (FileSystemEntity dir in dataDir.listSync()) { if (dir is Directory) { print('Compiling ${dir.path}'); diff --git a/pkg/testing/lib/src/discover.dart b/pkg/testing/lib/src/discover.dart index 6b761abb90f..193590b76a6 100644 --- a/pkg/testing/lib/src/discover.dart +++ b/pkg/testing/lib/src/discover.dart @@ -62,7 +62,7 @@ Stream listTests(List testRoots, Uri computePackageConfig() { String? path = Platform.packageConfig; if (path != null) return Uri.base.resolve(path); - return Uri.base.resolve(".packages"); + return Uri.base.resolve(".dart_tool/package_config.json"); } // TODO(eernst): Use `bool.hasEnvironment` below when possible;