diff --git a/pkg/front_end/outline_extraction_testcases/.dart_tool/package_config.json b/pkg/front_end/outline_extraction_testcases/.dart_tool/package_config.json new file mode 100644 index 00000000000..781616034bf --- /dev/null +++ b/pkg/front_end/outline_extraction_testcases/.dart_tool/package_config.json @@ -0,0 +1,4 @@ +{ + "configVersion": 2, + "packages": [] +} \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/.packages b/pkg/front_end/outline_extraction_testcases/.packages deleted file mode 100644 index 68325fa6d7e..00000000000 --- a/pkg/front_end/outline_extraction_testcases/.packages +++ /dev/null @@ -1 +0,0 @@ -# dummy \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/factories/.dart_tool/package_config.json b/pkg/front_end/outline_extraction_testcases/factories/.dart_tool/package_config.json new file mode 100644 index 00000000000..140964c143d --- /dev/null +++ b/pkg/front_end/outline_extraction_testcases/factories/.dart_tool/package_config.json @@ -0,0 +1,9 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] +} \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/factories/.packages b/pkg/front_end/outline_extraction_testcases/factories/.packages deleted file mode 100644 index 6607aecbc70..00000000000 --- a/pkg/front_end/outline_extraction_testcases/factories/.packages +++ /dev/null @@ -1 +0,0 @@ -foo:. \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.dart_tool/package_config.json b/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.dart_tool/package_config.json new file mode 100644 index 00000000000..140964c143d --- /dev/null +++ b/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.dart_tool/package_config.json @@ -0,0 +1,9 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] +} \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.packages b/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.packages deleted file mode 100644 index 6607aecbc70..00000000000 --- a/pkg/front_end/outline_extraction_testcases/named_import_with_export_and_named_constructor_and_class_type_parameter/.packages +++ /dev/null @@ -1 +0,0 @@ -foo:. \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/split_import_export_part/.dart_tool/package_config.json b/pkg/front_end/outline_extraction_testcases/split_import_export_part/.dart_tool/package_config.json new file mode 100644 index 00000000000..de99a55b009 --- /dev/null +++ b/pkg/front_end/outline_extraction_testcases/split_import_export_part/.dart_tool/package_config.json @@ -0,0 +1,9 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "foobar", + "rootUri": ".." + } + ] +} \ No newline at end of file diff --git a/pkg/front_end/outline_extraction_testcases/split_import_export_part/.packages b/pkg/front_end/outline_extraction_testcases/split_import_export_part/.packages deleted file mode 100644 index d19a7e08e3f..00000000000 --- a/pkg/front_end/outline_extraction_testcases/split_import_export_part/.packages +++ /dev/null @@ -1 +0,0 @@ -foobar:. \ No newline at end of file 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 fb27bc24d74..0823d43084c 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 @@ -33,7 +33,7 @@ Future main(List args) async { Uri packageConfigUri = repoDir.resolve(".dart_tool/package_config.json"); if (!new File.fromUri(packageConfigUri).existsSync()) { - throw "Couldn't find .packages"; + throw "Couldn't find .dart_tool/package_config.json"; } compilerOptions.packagesFileUri = packageConfigUri; diff --git a/pkg/front_end/test/fasta/messages_suite.dart b/pkg/front_end/test/fasta/messages_suite.dart index 3a90827898e..8c9862a1ea8 100644 --- a/pkg/front_end/test/fasta/messages_suite.dart +++ b/pkg/front_end/test/fasta/messages_suite.dart @@ -785,14 +785,13 @@ class Compile extends Step { Uri output = suite.fileSystem.currentDirectory.resolve("$dir/main.dart.dill"); - // Setup .packages if it (or package_config.json) doesn't exist. - Uri dotPackagesUri = - suite.fileSystem.currentDirectory.resolve("$dir/.packages"); - Uri packageConfigJsonUri = suite.fileSystem.currentDirectory + // Setup .dart_tool/package_config.json if it doesn't exist. + Uri packageConfigUri = suite.fileSystem.currentDirectory .resolve("$dir/.dart_tool/package_config.json"); - if (!await suite.fileSystem.entityForUri(dotPackagesUri).exists() && - !await suite.fileSystem.entityForUri(packageConfigJsonUri).exists()) { - suite.fileSystem.entityForUri(dotPackagesUri).writeAsBytesSync([]); + if (!await suite.fileSystem.entityForUri(packageConfigUri).exists()) { + suite.fileSystem + .entityForUri(packageConfigUri) + .writeAsStringSync('{"configVersion": 2, "packages": []}'); } print("Compiling $main"); @@ -805,7 +804,7 @@ class Compile extends Step { ..explicitExperimentalFlags = example.experimentalFlags ?? {} ..target = new VmTarget(new TargetFlags()) ..fileSystem = new HybridFileSystem(suite.fileSystem) - ..packagesFileUri = dotPackagesUri + ..packagesFileUri = packageConfigUri ..onDiagnostic = messages.add ..environmentDefines = const {}), main, diff --git a/pkg/front_end/test/flutter_gallery_leak_tester.dart b/pkg/front_end/test/flutter_gallery_leak_tester.dart index ff245b5befd..922bb318600 100644 --- a/pkg/front_end/test/flutter_gallery_leak_tester.dart +++ b/pkg/front_end/test/flutter_gallery_leak_tester.dart @@ -182,7 +182,7 @@ Future main(List args) async { "--output-dill", "$rootPath/flutter_server_tmp.dill", "--packages", - "$rootPath/gallery/.packages", + "$rootPath/gallery/.dart_tool/package_config.json", "-Ddart.vm.profile=false", "-Ddart.vm.product=false", "--enable-asserts", diff --git a/pkg/front_end/test/id_testing/data/directory_testing/.dart_tool/package_config.json b/pkg/front_end/test/id_testing/data/directory_testing/.dart_tool/package_config.json new file mode 100644 index 00000000000..27929acb345 --- /dev/null +++ b/pkg/front_end/test/id_testing/data/directory_testing/.dart_tool/package_config.json @@ -0,0 +1,9 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": "../lib" + } + ] +} diff --git a/pkg/front_end/test/incremental_suite.dart b/pkg/front_end/test/incremental_suite.dart index e96910bd7cc..78f31b473dc 100644 --- a/pkg/front_end/test/incremental_suite.dart +++ b/pkg/front_end/test/incremental_suite.dart @@ -400,7 +400,7 @@ Future basicTest(YamlMap sourceFiles, String entryPoint, invalidateFilenames.remove(filename); } String source = sourceFiles[filename]; - if (filename == ".packages") { + if (filename == ".dart_tool/package_config.json") { packagesUri = uri; } File file = new File.fromUri(uri); @@ -477,7 +477,7 @@ Future>> createModules( Uri? packagesUri; for (String filename in module[moduleName].keys) { Uri uri = base.resolve(filename); - if (uri.pathSegments.last == ".packages") { + if (uri.pathSegments.last == "package_config.json") { packagesUri = uri; } else { moduleSources.add(uri); @@ -683,9 +683,7 @@ class NewWorldTest { for (String filename in sourceFiles.keys) { String data = sourceFiles[filename] ?? ""; Uri uri = base.resolve(filename); - if (filename == ".packages") { - packagesUri = uri; - } else if (filename == ".dart_tool/package_config.json") { + if (filename == ".dart_tool/package_config.json") { packagesUri = uri; } if (world["enableStringReplacement"] == true) { @@ -693,8 +691,8 @@ class NewWorldTest { } fs.entityForUri(uri).writeAsStringSync(data); } - if (world["dotPackagesFile"] != null) { - packagesUri = base.resolve(world["dotPackagesFile"]); + if (world["packageConfigFile"] != null) { + packagesUri = base.resolve(world["packageConfigFile"]); } if (brandNewWorld) { diff --git a/pkg/front_end/test/lint_suite.dart b/pkg/front_end/test/lint_suite.dart index 2d919525051..009efff0191 100644 --- a/pkg/front_end/test/lint_suite.dart +++ b/pkg/front_end/test/lint_suite.dart @@ -167,23 +167,23 @@ class LintStep extends Step { description.cache.firstToken = scanner.tokenize(); description.cache.lineStarts = scanner.lineStarts; - Uri dotPackages = + Uri packageConfig = description.uri.resolve(".dart_tool/package_config.json"); while (true) { - if (new File.fromUri(dotPackages).existsSync()) { + if (new File.fromUri(packageConfig).existsSync()) { break; } // Stupid bailout. - if (dotPackages.pathSegments.length < Uri.base.pathSegments.length) { + if (packageConfig.pathSegments.length < Uri.base.pathSegments.length) { break; } - dotPackages = - dotPackages.resolve("../../.dart_tool/package_config.json"); + packageConfig = + packageConfig.resolve("../../.dart_tool/package_config.json"); } - File dotPackagesFile = new File.fromUri(dotPackages); - if (dotPackagesFile.existsSync()) { - description.cache.packages = await loadPackageConfigUri(dotPackages); + File packageConfigUri = new File.fromUri(packageConfig); + if (packageConfigUri.existsSync()) { + description.cache.packages = await loadPackageConfigUri(packageConfig); } } diff --git a/pkg/front_end/test/outline_extractor_suite.dart b/pkg/front_end/test/outline_extractor_suite.dart index 4548f0c4d3f..42adf8c80e5 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; } @@ -141,7 +141,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/testcases/incremental/changing_modules.yaml b/pkg/front_end/testcases/incremental/changing_modules.yaml index 534a0f4c7bb..e6638ae50d1 100644 --- a/pkg/front_end/testcases/incremental/changing_modules.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules.yaml @@ -22,8 +22,16 @@ modules: b() { a(); } - example_0.1.0/.packages: | - example:. + example_0.1.0/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": ".." + } + ] + } example_0.1.1: example_0.1.1/b.dart: | // @dart=2.9 @@ -31,8 +39,16 @@ modules: print("Hello from v0.1.1"); } bool example011 = true; - example_0.1.1/.packages: | - example:. + example_0.1.1/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": ".." + } + ] + } foo_1: foo_1/foo.dart: | // @dart=2.9 @@ -42,9 +58,20 @@ modules: b(); } bool foo1 = true; - foo_1/.packages: | - foo:. - example:../example_0.1.0 + foo_1/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + }, + { + "name": "example", + "rootUri": "../../example_0.1.0" + } + ] + } foo_2: foo_2/foo.dart: | // @dart=2.9 @@ -68,9 +95,20 @@ modules: baz() { print("hello from baz"); } - foo_2/.packages: | - foo:. - example:../example_0.1.1 + foo_2/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + }, + { + "name": "example", + "rootUri": "../../example_0.1.1" + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -82,7 +120,16 @@ worlds: print("hello"); b(); } - .packages: example:example_0.1.0 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../example_0.1.0" + } + ] + } modules: - example_0.1.0 expectedLibraryCount: 3 @@ -108,9 +155,20 @@ worlds: print("hello"); foo(); } - .packages: | - example:example_0.1.0 - foo:foo_1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../example_0.1.0" + }, + { + "name": "foo", + "rootUri": "../foo_1" + } + ] + } modules: - example_0.1.0 - foo_1 @@ -139,9 +197,20 @@ worlds: print("hello"); foo(); } - .packages: | - example:example_0.1.1 - foo:foo_2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../example_0.1.1" + }, + { + "name": "foo", + "rootUri": "../foo_2" + } + ] + } modules: - example_0.1.1 - foo_2 diff --git a/pkg/front_end/testcases/incremental/changing_modules_10.yaml b/pkg/front_end/testcases/incremental/changing_modules_10.yaml index 1cdaafd10b1..e81be3815af 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_10.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_10.yaml @@ -18,8 +18,16 @@ modules: module/b.dart: | // @dart=2.9 class B { } - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -28,8 +36,16 @@ worlds: // @dart=2.9 import 'package:module/a.dart'; class Foo extends A {} - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 3 diff --git a/pkg/front_end/testcases/incremental/changing_modules_11.yaml b/pkg/front_end/testcases/incremental/changing_modules_11.yaml index aedd5d0f9db..e433d986ff6 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_11.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_11.yaml @@ -18,8 +18,16 @@ modules: module/b.dart: | // @dart=2.9 class B { } - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -28,8 +36,16 @@ worlds: // @dart=2.9 import 'package:module/a.dart'; class Foo extends A {} - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 3 diff --git a/pkg/front_end/testcases/incremental/changing_modules_12.yaml b/pkg/front_end/testcases/incremental/changing_modules_12.yaml index c8f1caea8cc..082cc0ab881 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_12.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_12.yaml @@ -24,8 +24,16 @@ modules: // @dart=2.9 import 'package:module/c.dart'; class D { } - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -33,8 +41,16 @@ worlds: main.dart: | // @dart=2.9 class Foo {} - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 1 diff --git a/pkg/front_end/testcases/incremental/changing_modules_13.yaml b/pkg/front_end/testcases/incremental/changing_modules_13.yaml index 5d042e91c13..d92b7ca6e74 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_13.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_13.yaml @@ -14,8 +14,16 @@ modules: class B { } class C { } class AB = A with B; - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -24,8 +32,16 @@ worlds: // @dart=2.9 import "package:module/a.dart"; class ABC = AB with C; - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 2 diff --git a/pkg/front_end/testcases/incremental/changing_modules_14.yaml b/pkg/front_end/testcases/incremental/changing_modules_14.yaml index 641accff220..77d4395c8ba 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_14.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_14.yaml @@ -12,16 +12,37 @@ target: DDC modules: moduleC: moduleC/lib.dart: | + // @dart=2.9 const constC = ['value_c']; - moduleC/.packages: | - moduleC:. + moduleC/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleC", + "rootUri": ".." + } + ] + } moduleB: moduleB/lib.dart: | + // @dart=2.9 import "package:moduleC/lib.dart"; const constB = ['value_b', constC]; - moduleB/.packages: | - moduleB:. - moduleC:../moduleC + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + }, + { + "name": "moduleC", + "rootUri": "../../moduleC" + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -33,9 +54,20 @@ worlds: const constLib = constFromLib; lib.dart: | const constFromLib = 42; - .packages: | - moduleB:moduleB - moduleC:moduleC + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": "../moduleB" + }, + { + "name": "moduleC", + "rootUri": "../moduleC" + } + ] + } modules: - moduleB - moduleC diff --git a/pkg/front_end/testcases/incremental/changing_modules_15.yaml b/pkg/front_end/testcases/incremental/changing_modules_15.yaml index d0753b84d79..f1c41021cd1 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_15.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_15.yaml @@ -12,16 +12,37 @@ target: DDC modules: moduleC: moduleC/lib.dart: | + // @dart=2.9 const constC = true; - moduleC/.packages: | - moduleC:. + moduleC/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleC", + "rootUri": ".." + } + ] + } moduleB: moduleB/lib.dart: | + // @dart=2.9 import "package:moduleC/lib.dart"; const constB = false || constC; - moduleB/.packages: | - moduleB:. - moduleC:../moduleC + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + }, + { + "name": "moduleC", + "rootUri": "../../moduleC" + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -29,9 +50,20 @@ worlds: main.dart: | import 'package:moduleB/lib.dart'; const constA = true && constB; - .packages: | - moduleB:moduleB - moduleC:moduleC + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": "../moduleB" + }, + { + "name": "moduleC", + "rootUri": "../moduleC" + } + ] + } modules: - moduleB - moduleC diff --git a/pkg/front_end/testcases/incremental/changing_modules_2.yaml b/pkg/front_end/testcases/incremental/changing_modules_2.yaml index b8db340e24c..a73afd8c3b2 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_2.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_2.yaml @@ -12,22 +12,50 @@ modules: // @dart=2.9 a() {} var example = true; - example_1/.packages: | - example:. + example_1/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": ".." + } + ] + } example_2: example_2/a.dart: | // @dart=2.9 a() {} var example = true; - example_2/.packages: | - example:. + example_2/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": ".." + } + ] + } foo: foo/foo.dart: | + // @dart=2.9 export "package:example/a.dart"; var foo = true; - foo/.packages: | - foo:. - example:../example_1 + foo/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + }, + { + "name": "example", + "rootUri": "../../example_1" + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -38,9 +66,20 @@ worlds: print("hello"); a(); } - .packages: | - foo:foo - example:example_1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": "../foo" + }, + { + "name": "example", + "rootUri": "../../example_1" + } + ] + } modules: - foo - example_1 @@ -60,9 +99,20 @@ worlds: worldType: updated expectInitializeFromDill: false sources: - .packages: | - foo:foo - example:example_2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": "../foo" + }, + { + "name": "example", + "rootUri": "../../example_2" + } + ] + } modules: - foo - example_2 diff --git a/pkg/front_end/testcases/incremental/changing_modules_3.yaml b/pkg/front_end/testcases/incremental/changing_modules_3.yaml index fdfb2a6c4ae..b8e864b88f3 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_3.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_3.yaml @@ -11,14 +11,30 @@ modules: foo/foo.dart: | // @dart=2.9 var foo = true; - foo/.packages: | - foo:. + foo/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } foo2: foo2/foo.dart: | // @dart=2.9 var foo2 = true; - foo2/.packages: | - foo:. + foo2/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -30,8 +46,16 @@ worlds: main() { print(foo); } - .packages: | - foo:foo + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": "../foo" + } + ] + } modules: - foo expectedLibraryCount: 2 @@ -55,8 +79,16 @@ worlds: main() { print(foo2); } - .packages: | - foo:foo2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": "../foo2" + } + ] + } modules: - foo2 expectedLibraryCount: 2 diff --git a/pkg/front_end/testcases/incremental/changing_modules_4.yaml b/pkg/front_end/testcases/incremental/changing_modules_4.yaml index 98ba2fa5a27..3e155a280b0 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_4.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_4.yaml @@ -19,10 +19,24 @@ modules: class A2 extends A3 { int bar = 42; } - moduleB/.packages: | - moduleB:. - moduleC:../moduleC - moduleD:../moduleD + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + }, + { + "name": "moduleC", + "rootUri": "../../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleC: moduleC/c.dart: | // @dart=2.9 @@ -34,15 +48,34 @@ modules: class A3 { int foo = 42; } - moduleC/.packages: | - moduleC:. - moduleD:../moduleD + moduleC/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleC", + "rootUri": ".." + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleD: moduleD/d.dart: | // @dart=2.9 String baz3 = "baz3"; - moduleD/.packages: | - moduleD:. + moduleD/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleD", + "rootUri": ".." + } + ] + } worlds: - entry: a.dart fromComponent: true @@ -53,10 +86,24 @@ worlds: String foo = baz; var x = mya2.bar; - .packages: | - moduleB:moduleB - moduleC:moduleC - moduleD:moduleD + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": "../moduleB" + }, + { + "name": "moduleC", + "rootUri": "../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../moduleD" + } + ] + } modules: - moduleB - moduleC diff --git a/pkg/front_end/testcases/incremental/changing_modules_5.yaml b/pkg/front_end/testcases/incremental/changing_modules_5.yaml index b044f038fe6..4cd4a5f52af 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_5.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_5.yaml @@ -20,10 +20,24 @@ modules: class A2 extends A3 { int bar = 42; } - moduleB/.packages: | - moduleB:. - moduleC:../moduleC - moduleD:../moduleD + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + }, + { + "name": "moduleC", + "rootUri": "../../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleC: moduleC/c.dart: | // @dart=2.9 @@ -35,15 +49,34 @@ modules: class A3 { int foo = 42; } - moduleC/.packages: | - moduleC:. - moduleD:../moduleD + moduleC/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleC", + "rootUri": ".." + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleD: moduleD/d.dart: | // @dart=2.9 String baz3 = "baz3"; - moduleD/.packages: | - moduleD:. + moduleD/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleD", + "rootUri": ".." + } + ] + } worlds: - entry: a.dart fromComponent: true @@ -54,10 +87,24 @@ worlds: var foo = bVar; var foo2 = bVarFromC; - .packages: | - moduleB:moduleB - moduleC:moduleC - moduleD:moduleD + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": "../moduleB" + }, + { + "name": "moduleC", + "rootUri": "../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../moduleD" + } + ] + } modules: - moduleB - moduleC diff --git a/pkg/front_end/testcases/incremental/changing_modules_6.yaml b/pkg/front_end/testcases/incremental/changing_modules_6.yaml index c66ca3b9ca3..ee9094bb6dd 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_6.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_6.yaml @@ -20,10 +20,24 @@ modules: class A2 extends A3 { int bar = 42; } - moduleB/.packages: | - moduleB:. - moduleC:../moduleC - moduleD:../moduleD + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + }, + { + "name": "moduleC", + "rootUri": "../../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleC: moduleC/c.dart: | // @dart=2.9 @@ -35,15 +49,34 @@ modules: class A3 { int foo = 42; } - moduleC/.packages: | - moduleC:. - moduleD:../moduleD + moduleC/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleC", + "rootUri": ".." + }, + { + "name": "moduleD", + "rootUri": "../../moduleD" + } + ] + } moduleD: moduleD/d.dart: | // @dart=2.9 String baz3 = "baz3"; - moduleD/.packages: | - moduleD:. + moduleD/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleD", + "rootUri": ".." + } + ] + } worlds: - entry: a.dart fromComponent: true @@ -58,10 +91,24 @@ worlds: class A1 extends A2 { String fooMethod() => "42!"; } - .packages: | - moduleB:moduleB - moduleC:moduleC - moduleD:moduleD + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": "../moduleB" + }, + { + "name": "moduleC", + "rootUri": "../moduleC" + }, + { + "name": "moduleD", + "rootUri": "../moduleD" + } + ] + } modules: - moduleB - moduleC diff --git a/pkg/front_end/testcases/incremental/changing_modules_7.yaml b/pkg/front_end/testcases/incremental/changing_modules_7.yaml index f718f140416..28632d3b539 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_7.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_7.yaml @@ -36,9 +36,18 @@ modules: String str() {} } module/lib4.dart: | + // @dart=2.9 class Class4 {} - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: compileme.dart fromComponent: true @@ -60,8 +69,16 @@ worlds: return class1; } } - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 5 @@ -105,8 +122,16 @@ worlds: return class1; } } - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 5 diff --git a/pkg/front_end/testcases/incremental/changing_modules_8.yaml b/pkg/front_end/testcases/incremental/changing_modules_8.yaml index 42de9b44b32..118080cfdef 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_8.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_8.yaml @@ -31,8 +31,16 @@ modules: class XIdentityHashSet implements XLinkedHashSet { XIdentityHashSet(); } - module/.packages: | - module:. + module/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": ".." + } + ] + } worlds: - entry: compileme.dart fromComponent: true @@ -44,8 +52,16 @@ worlds: main() { XSet history = new XSet.identity(); } - .packages: | - module:module + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "module", + "rootUri": "../module" + } + ] + } modules: - module expectedLibraryCount: 4 diff --git a/pkg/front_end/testcases/incremental/changing_modules_9.yaml b/pkg/front_end/testcases/incremental/changing_modules_9.yaml index 85ef80a270c..e267a819ba6 100644 --- a/pkg/front_end/testcases/incremental/changing_modules_9.yaml +++ b/pkg/front_end/testcases/incremental/changing_modules_9.yaml @@ -14,17 +14,36 @@ modules: export 'package:moduleB/b.dart'; class A { } - moduleA/.packages: | - moduleA:. - moduleB:../moduleB + moduleA/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleA", + "rootUri": ".." + }, + { + "name": "moduleB", + "rootUri": "../../moduleB" + } + ] + } moduleB: moduleB/b.dart: | // @dart=2.9 class B { int foo = 42; } - moduleB/.packages: | - moduleB:. + moduleB/.dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleB", + "rootUri": ".." + } + ] + } worlds: - entry: main.dart fromComponent: true @@ -36,9 +55,20 @@ worlds: main() { A a = new A(); } - .packages: | - moduleA:moduleA - moduleB:moduleB + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "moduleA", + "rootUri": "../moduleA" + }, + { + "name": "moduleB", + "rootUri": "../moduleB" + } + ] + } modules: - moduleA - moduleB diff --git a/pkg/front_end/testcases/incremental/cleans_up_uritosource_unreferenced_package_library.yaml b/pkg/front_end/testcases/incremental/cleans_up_uritosource_unreferenced_package_library.yaml index 4e07d258de1..ea47771954d 100644 --- a/pkg/front_end/testcases/incremental/cleans_up_uritosource_unreferenced_package_library.yaml +++ b/pkg/front_end/testcases/incremental/cleans_up_uritosource_unreferenced_package_library.yaml @@ -2,16 +2,25 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE.md file. -# Compile an application with a package. Update the world so that the .packages -# no longer reference the package (and the source no longe ruse it) and -# recompile. The now no longer referenced package library should also have been -# removed from the uri to sources. +# Compile an application with a package. Update the world so that the +# .dart_tool/package_config.json no longer reference the package (and the source +# no longer use it) and recompile. The now no longer referenced package library +# should also have been removed from the uri to sources. type: newworld worlds: - entry: main.dart sources: - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } main.dart: | // @dart=2.9 import "package:example/b.dart"; @@ -24,10 +33,14 @@ worlds: worldType: updated invalidate: - main.dart - - .packages + - .dart_tool/package_config.json expectInitializeFromDill: false sources: - .packages: + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [] + } main.dart: | // @dart=2.9 main() {} diff --git a/pkg/front_end/testcases/incremental/disappearing_package.yaml b/pkg/front_end/testcases/incremental/disappearing_package.yaml index fe8d1575c53..5349d99e6a4 100644 --- a/pkg/front_end/testcases/incremental/disappearing_package.yaml +++ b/pkg/front_end/testcases/incremental/disappearing_package.yaml @@ -3,8 +3,8 @@ # BSD-style license that can be found in the LICENSE.md file. # Compile an application with a package and use it. -# Then remove the package from .packages and remove any use of it. -# The package is still included in the dill file we initialize from, +# Then remove the package from .dart_tool/package_config.json and remove any use +# of it. The package is still included in the dill file we initialize from, # but shouldn't cause trouble, nor be included in the output. type: newworld @@ -23,7 +23,16 @@ worlds: b() { print("b"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 2 - entry: main.dart # TODO(jensj): For now we don't initialize from dill when a package was @@ -37,5 +46,9 @@ worlds: main() { print("hello"); } - .packages: + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [] + } expectedLibraryCount: 1 diff --git a/pkg/front_end/testcases/incremental/entry_not_package_url_main.yaml b/pkg/front_end/testcases/incremental/entry_not_package_url_main.yaml index 4260828facd..1f881a70182 100644 --- a/pkg/front_end/testcases/incremental/entry_not_package_url_main.yaml +++ b/pkg/front_end/testcases/incremental/entry_not_package_url_main.yaml @@ -13,7 +13,16 @@ worlds: // @dart=2.9 main() { } - .packages: untitled:/ + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "untitled", + "rootUri": "/" + } + ] + } expectedLibraryCount: 1 errors: false warnings: false diff --git a/pkg/front_end/testcases/incremental/entry_not_package_url_main_with_errors.yaml b/pkg/front_end/testcases/incremental/entry_not_package_url_main_with_errors.yaml index e7b80f2e1fb..4c8beb6bfdd 100644 --- a/pkg/front_end/testcases/incremental/entry_not_package_url_main_with_errors.yaml +++ b/pkg/front_end/testcases/incremental/entry_not_package_url_main_with_errors.yaml @@ -15,7 +15,16 @@ worlds: main() { asdf; } - .packages: untitled:/ + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "untitled", + "rootUri": "/" + } + ] + } expectedLibraryCount: 1 errors: true warnings: false diff --git a/pkg/front_end/testcases/incremental/entry_not_package_url_no_main.yaml b/pkg/front_end/testcases/incremental/entry_not_package_url_no_main.yaml index 72eac403f6a..a070cbbea1d 100644 --- a/pkg/front_end/testcases/incremental/entry_not_package_url_no_main.yaml +++ b/pkg/front_end/testcases/incremental/entry_not_package_url_no_main.yaml @@ -12,7 +12,16 @@ worlds: main.dart: | // @dart=2.9 notMain() {} - .packages: untitled:/ + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "untitled", + "rootUri": "/" + } + ] + } expectedLibraryCount: 1 errors: false warnings: false diff --git a/pkg/front_end/testcases/incremental/flutter_widget_transform.yaml b/pkg/front_end/testcases/incremental/flutter_widget_transform.yaml index 0072fcb0e8d..01cc15f6db0 100644 --- a/pkg/front_end/testcases/incremental/flutter_widget_transform.yaml +++ b/pkg/front_end/testcases/incremental/flutter_widget_transform.yaml @@ -51,8 +51,16 @@ worlds: /// Optional locations of the parameters of the member at this location. final List<_Location> parameterLocations; } - .packages: | - flutter:flutter/lib + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "flutter", + "rootUri": "../flutter/lib" + } + ] + } expectedLibraryCount: 3 - entry: main.dart worldType: updated diff --git a/pkg/front_end/testcases/incremental/incremental_serialization_1.yaml b/pkg/front_end/testcases/incremental/incremental_serialization_1.yaml index fa1166f1442..3e639115357 100644 --- a/pkg/front_end/testcases/incremental/incremental_serialization_1.yaml +++ b/pkg/front_end/testcases/incremental/incremental_serialization_1.yaml @@ -34,9 +34,20 @@ worlds: lib3() { return lib1(); } - .packages: | - package1:package1 - package2:package2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1" + }, + { + "name": "package2", + "rootUri": "../package2" + } + ] + } expectedLibraryCount: 4 incrementalSerializationDoesWork: true - entry: main.dart diff --git a/pkg/front_end/testcases/incremental/incremental_serialization_2.yaml b/pkg/front_end/testcases/incremental/incremental_serialization_2.yaml index 997b7378f22..15fb17a1982 100644 --- a/pkg/front_end/testcases/incremental/incremental_serialization_2.yaml +++ b/pkg/front_end/testcases/incremental/incremental_serialization_2.yaml @@ -36,8 +36,16 @@ worlds: lib3() { return lib1(); } - .packages: | - package1:package1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1" + } + ] + } expectedLibraryCount: 4 incrementalSerializationDoesWork: true - entry: main.dart diff --git a/pkg/front_end/testcases/incremental/incremental_serialization_3.yaml b/pkg/front_end/testcases/incremental/incremental_serialization_3.yaml index 775b3229051..e3664d70d4e 100644 --- a/pkg/front_end/testcases/incremental/incremental_serialization_3.yaml +++ b/pkg/front_end/testcases/incremental/incremental_serialization_3.yaml @@ -46,10 +46,24 @@ worlds: lib3() { print("lib3"); } - .packages: | - package1:package1 - package2:package2 - package3:package3 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1" + }, + { + "name": "package2", + "rootUri": "../package2" + }, + { + "name": "package3", + "rootUri": "../package3" + } + ] + } expectedLibraryCount: 5 incrementalSerializationDoesWork: true - entry: main.dart @@ -89,9 +103,23 @@ worlds: lib3() { print("lib3"); } - .packages: | - package1:package1 - package2:package2 - package3:package3 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1" + }, + { + "name": "package2", + "rootUri": "../package2" + }, + { + "name": "package3", + "rootUri": "../package3" + } + ] + } expectedLibraryCount: 5 incrementalSerializationDoesWork: true diff --git a/pkg/front_end/testcases/incremental/incremental_serialization_4.yaml b/pkg/front_end/testcases/incremental/incremental_serialization_4.yaml index a9c75d538dd..144fc2c6f0f 100644 --- a/pkg/front_end/testcases/incremental/incremental_serialization_4.yaml +++ b/pkg/front_end/testcases/incremental/incremental_serialization_4.yaml @@ -45,9 +45,20 @@ worlds: p1(); print("Package 2"); } - .packages: | - package1:package1 - package2:package2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1" + }, + { + "name": "package2", + "rootUri": "../package2" + } + ] + } expectedLibraryCount: 3 incrementalSerializationDoesWork: true - entry: main.dart @@ -86,8 +97,19 @@ worlds: p1(); print("Package 2"); } - .packages: | - package1:package1v2 - package2:package2 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "package1", + "rootUri": "../package1v2" + }, + { + "name": "package2", + "rootUri": "../package2" + } + ] + } expectedLibraryCount: 3 incrementalSerializationDoesWork: true diff --git a/pkg/front_end/testcases/incremental/initialize_with_unused_package_then_use_type.yaml b/pkg/front_end/testcases/incremental/initialize_with_unused_package_then_use_type.yaml index 6460d792820..dd9cc980a82 100644 --- a/pkg/front_end/testcases/incremental/initialize_with_unused_package_then_use_type.yaml +++ b/pkg/front_end/testcases/incremental/initialize_with_unused_package_then_use_type.yaml @@ -27,7 +27,16 @@ worlds: print("Foo!"); } } - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } expectedLibraryCount: 2 - entry: main.dart invalidate: @@ -45,7 +54,16 @@ worlds: print("Foo!"); } } - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } expectedLibraryCount: 1 expectInitializeFromDill: true - entry: main.dart diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part.yaml index 7fee6d061aa..224d6154df2 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part.yaml @@ -22,7 +22,16 @@ worlds: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 - entry: "package:example/main.dart" invalidate: @@ -43,7 +52,16 @@ worlds: b() { print("b2"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 - entry: "package:example/main.dart" invalidate: @@ -64,5 +82,14 @@ worlds: b() { print("b3"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part_2.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part_2.yaml index 2e6331140fe..c8635e8574b 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part_2.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part_2.yaml @@ -21,7 +21,16 @@ worlds: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 - entry: "package:example/main.dart" worldType: updated @@ -37,7 +46,16 @@ worlds: b() { print("b2"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 - entry: "package:example/main.dart" worldType: updated @@ -53,5 +71,14 @@ worlds: b() { print("b3"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } expectedLibraryCount: 1 diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part_as_file.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part_as_file.yaml index 4e2cd4da10e..b6fc99f4ad4 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part_as_file.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part_as_file.yaml @@ -22,4 +22,13 @@ sources: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part_as_package.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part_as_package.yaml index 68e2d37ffbb..6519fd4b4dd 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part_as_package.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part_as_package.yaml @@ -22,4 +22,13 @@ sources: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_file.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_file.yaml index ee3691451a7..17c374abf6e 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_file.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_file.yaml @@ -23,4 +23,13 @@ sources: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } diff --git a/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_package.yaml b/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_package.yaml index 5af601b77b8..d79692eaf03 100644 --- a/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_package.yaml +++ b/pkg/front_end/testcases/incremental/invalidate_package_part_from_package_url_as_package.yaml @@ -23,4 +23,13 @@ sources: b() { print("b1"); } - .packages: example:pkg/example + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../pkg/example" + } + ] + } diff --git a/pkg/front_end/testcases/incremental/no_outline_change_27.yaml b/pkg/front_end/testcases/incremental/no_outline_change_27.yaml index 8f4c25d06ba..380c552b914 100644 --- a/pkg/front_end/testcases/incremental/no_outline_change_27.yaml +++ b/pkg/front_end/testcases/incremental/no_outline_change_27.yaml @@ -22,8 +22,16 @@ worlds: libMethod() { print("Hello from lib!"); } - .packages: | - foo:. + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } expectedLibraryCount: 2 - entry: main.dart warnings: false diff --git a/pkg/front_end/testcases/incremental/part_as_package_entry.yaml b/pkg/front_end/testcases/incremental/part_as_package_entry.yaml index 9aed0c25229..9810036ccd1 100644 --- a/pkg/front_end/testcases/incremental/part_as_package_entry.yaml +++ b/pkg/front_end/testcases/incremental/part_as_package_entry.yaml @@ -7,8 +7,16 @@ worlds: - entry: package:foo/main.dart checkEntries: false sources: - .packages: | - foo:. + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } main.dart: | // @dart=2.9 part of 'lib.dart'; diff --git a/pkg/front_end/testcases/incremental/part_as_package_entry_2.yaml b/pkg/front_end/testcases/incremental/part_as_package_entry_2.yaml index 27bb66ca4fa..2ac3ec6f285 100644 --- a/pkg/front_end/testcases/incremental/part_as_package_entry_2.yaml +++ b/pkg/front_end/testcases/incremental/part_as_package_entry_2.yaml @@ -8,8 +8,16 @@ worlds: warnings: false checkEntries: false sources: - .packages: | - foo:. + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } main.dart: | // @dart=2.9 part of 'lib.dart'; diff --git a/pkg/front_end/testcases/incremental/part_not_part_of_as_package.yaml b/pkg/front_end/testcases/incremental/part_not_part_of_as_package.yaml index 91106066380..a3c62ed58a5 100644 --- a/pkg/front_end/testcases/incremental/part_not_part_of_as_package.yaml +++ b/pkg/front_end/testcases/incremental/part_not_part_of_as_package.yaml @@ -7,8 +7,16 @@ worlds: - entry: package:foo/main.dart errors: true sources: - .packages: | - foo:. + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "foo", + "rootUri": ".." + } + ] + } main.dart: | // @dart=2.9 part 'lib.dart'; diff --git a/pkg/front_end/testcases/incremental/reissue_errors_3.yaml b/pkg/front_end/testcases/incremental/reissue_errors_3.yaml index b93e15d902e..fc0ac604a27 100644 --- a/pkg/front_end/testcases/incremental/reissue_errors_3.yaml +++ b/pkg/front_end/testcases/incremental/reissue_errors_3.yaml @@ -10,7 +10,16 @@ type: newworld worlds: - entry: main.dart sources: - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } main.dart: | // @dart=2.9 import "package:mypackage/a.dart"; @@ -34,7 +43,16 @@ worlds: expectedLibraryCount: 3 - entry: main.dart sources: - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } main.dart: | // @dart=2.9 import "package:mypackage/a.dart"; diff --git a/pkg/front_end/testcases/incremental/reissue_errors_4.yaml b/pkg/front_end/testcases/incremental/reissue_errors_4.yaml index 47f97882bc7..b53906c9e2c 100644 --- a/pkg/front_end/testcases/incremental/reissue_errors_4.yaml +++ b/pkg/front_end/testcases/incremental/reissue_errors_4.yaml @@ -10,7 +10,16 @@ type: newworld worlds: - entry: main.dart sources: - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } main.dart: | // @dart=2.9 import "package:mypackage/a.dart"; @@ -38,7 +47,16 @@ worlds: expectedLibraryCount: 3 - entry: main.dart sources: - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } main.dart: | // @dart=2.9 import "package:mypackage/a.dart"; diff --git a/pkg/front_end/testcases/incremental/reissue_errors_5.yaml b/pkg/front_end/testcases/incremental/reissue_errors_5.yaml index 36e836191dc..861b204e3cd 100644 --- a/pkg/front_end/testcases/incremental/reissue_errors_5.yaml +++ b/pkg/front_end/testcases/incremental/reissue_errors_5.yaml @@ -10,7 +10,16 @@ type: newworld worlds: - entry: main.dart sources: - .packages: mypackage:mypackage + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "mypackage", + "rootUri": "../mypackage" + } + ] + } main.dart: | // @dart=2.9 import "package:mypackage/a.dart" as a; diff --git a/pkg/front_end/testcases/incremental/updated_package_1.yaml b/pkg/front_end/testcases/incremental/updated_package_1.yaml index 6950f986c30..67c83b06b1f 100644 --- a/pkg/front_end/testcases/incremental/updated_package_1.yaml +++ b/pkg/front_end/testcases/incremental/updated_package_1.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE.md file. # Compile an application with a package and use it. -# Then update the package from .packages. +# Then update the package from .dart_tool/package_config.json. # The old package is still included in the dill file we initialize from, # but shouldn't cause trouble, nor be included in the output. @@ -32,7 +32,16 @@ worlds: b() { a(); } - .packages: example:package_0.1.0 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.0" + } + ] + } expectedLibraryCount: 3 - entry: main.dart # TODO(jensj): For now we don't initialize from dill when a package was @@ -67,5 +76,14 @@ worlds: b() { print("hello from v0.1.1"); } - .packages: example:package_0.1.1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.1" + } + ] + } expectedLibraryCount: 2 diff --git a/pkg/front_end/testcases/incremental/updated_package_2.yaml b/pkg/front_end/testcases/incremental/updated_package_2.yaml index 34110bab106..6e7ae115cbd 100644 --- a/pkg/front_end/testcases/incremental/updated_package_2.yaml +++ b/pkg/front_end/testcases/incremental/updated_package_2.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE.md file. # Compile an application with a package and use it. -# Then update the package from .packages. +# Then update the package from .dart_tool/package_config.json. # The old package is still included in the dill file we initialize from, # but shouldn't cause trouble, nor be included in the output. @@ -32,7 +32,16 @@ worlds: b() { a(); } - .packages: example:package_0.1.0 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.0" + } + ] + } expectedLibraryCount: 3 - entry: main.dart invalidate: @@ -66,5 +75,14 @@ worlds: b() { print("hello from v0.1.1"); } - .packages: example:package_0.1.1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.1" + } + ] + } expectedLibraryCount: 2 diff --git a/pkg/front_end/testcases/incremental/updated_package_3.yaml b/pkg/front_end/testcases/incremental/updated_package_3.yaml index faf431eefec..e3b97b717ae 100644 --- a/pkg/front_end/testcases/incremental/updated_package_3.yaml +++ b/pkg/front_end/testcases/incremental/updated_package_3.yaml @@ -3,8 +3,8 @@ # BSD-style license that can be found in the LICENSE.md file. # Compile an application with a package and use it. -# Then update the package from .packages but change nothing else and call -# computeDelta on the same compiler. +# Then update the package from .dart_tool/package_config.json but change nothing +# else and call computeDelta on the same compiler. # The output should not include the old package. type: newworld @@ -32,7 +32,16 @@ worlds: b() { a(); } - .packages: example:package_0.1.0 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.0" + } + ] + } expectedLibraryCount: 3 - entry: main.dart worldType: updated @@ -46,5 +55,14 @@ worlds: b() { print("hello from v0.1.1"); } - .packages: example:package_0.1.1 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.1" + } + ] + } expectedLibraryCount: 2 diff --git a/pkg/front_end/testcases/incremental/updated_package_4.yaml b/pkg/front_end/testcases/incremental/updated_package_4.yaml index 4d2fd14f684..e5d21b35d9c 100644 --- a/pkg/front_end/testcases/incremental/updated_package_4.yaml +++ b/pkg/front_end/testcases/incremental/updated_package_4.yaml @@ -2,9 +2,9 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE.md file. -# Compile an application with a .packages. -# Then delete the content of .packages, still using the package in code. -# This should be an error. +# Compile an application with a .dart_tool/package_config.json. +# Then delete the content of .dart_tool/package_config.json, still using the +# package in code. This should be an error. type: newworld worlds: @@ -22,15 +22,28 @@ worlds: b() { print("hello from package"); } - .packages: example:package + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package" + } + ] + } expectedLibraryCount: 2 - entry: main.dart worldType: updated expectInitializeFromDill: false checkInvalidatedFiles: false invalidate: - - .packages + - .dart_tool/package_config.json sources: - .packages: + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [] + } errors: true expectedLibraryCount: 1 diff --git a/pkg/front_end/testcases/incremental/updated_package_uri.yaml b/pkg/front_end/testcases/incremental/updated_package_uri.yaml index f8e7ad9078d..53d17254dff 100644 --- a/pkg/front_end/testcases/incremental/updated_package_uri.yaml +++ b/pkg/front_end/testcases/incremental/updated_package_uri.yaml @@ -2,9 +2,10 @@ # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE.md file. -# Compile an application with a .packages file. -# Then change which file should be the .packages file to use, and everything -# should now be relative to the new .packages file. +# Compile an application with a .dart_tool/package_config.json file. +# Then change which file should be the package_config.json file to +# use, and everything should now be relative to the new +# package_config.json file. type: newworld worlds: @@ -31,7 +32,16 @@ worlds: b() { a(); } - .packages: example:package_0.1.0 + .dart_tool/package_config.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.0" + } + ] + } expectedLibraryCount: 3 - entry: main.dart worldType: updated @@ -42,6 +52,15 @@ worlds: b() { print("hello from v0.1.1"); } - .packages2: example:package_0.1.1 - dotPackagesFile: .packages2 + .dart_tool/package_config2.json: | + { + "configVersion": 2, + "packages": [ + { + "name": "example", + "rootUri": "../package_0.1.1" + } + ] + } + packageConfigFile: .dart_tool/package_config2.json expectedLibraryCount: 2 diff --git a/pkg/front_end/tool/fasta_perf.dart b/pkg/front_end/tool/fasta_perf.dart index 6c5a003f56b..ba61cb1ec69 100644 --- a/pkg/front_end/tool/fasta_perf.dart +++ b/pkg/front_end/tool/fasta_perf.dart @@ -90,7 +90,7 @@ Future setup(Uri entryUri) async { // allowlisting of error messages in the error handler. ..onDiagnostic = onDiagnosticMessageHandler() ..compileSdk = true - ..packagesFileUri = Uri.base.resolve('.packages') + ..packagesFileUri = Uri.base.resolve('.dart_tool/package_config.json') ..target = createTarget(isFlutter: false); uriResolver = await new ProcessedOptions(options: options).getUriTranslator(); } @@ -231,7 +231,7 @@ Future generateKernel(Uri entryUri, ..sdkRoot = sdkRoot ..onDiagnostic = onDiagnosticMessageHandler() ..target = createTarget(isFlutter: false) - ..packagesFileUri = Uri.base.resolve('.packages') + ..packagesFileUri = Uri.base.resolve('.dart_tool/package_config.json') ..compileSdk = compileSdk ..environmentDefines = const {}; if (!compileSdk) { diff --git a/pkg/front_end/tool/incremental_perf.dart b/pkg/front_end/tool/incremental_perf.dart index 0a1186dbc22..dc1c3bbbad7 100644 --- a/pkg/front_end/tool/incremental_perf.dart +++ b/pkg/front_end/tool/incremental_perf.dart @@ -215,9 +215,9 @@ class OverlayFileSystem implements FileSystem { if (uri.isScheme('org-dartlang-overlay')) { return new OverlayFileSystemEntity(uri, this); } else if (uri.isScheme('file')) { - // The IKG compiler reads ".packages" which might contain absolute file - // URIs (which it will then try to use on the FS). We therefore replace - // them with overlay-fs URIs as usual. + // The IKG compiler reads ".dart_tool/package_config.json" which might + // contain absolute file URIs (which it will then try to use on the FS). + // We therefore replace them with overlay-fs URIs as usual. return new OverlayFileSystemEntity(_resolveOverlayUri('$uri'), this); } else { throw "Unsupported scheme: ${uri.scheme}."