diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index 0260784670..1ef94c7376 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -36,7 +36,7 @@ class BuildInfo { List? dartExperiments, required this.treeShakeIcons, this.performanceMeasurementFile, - this.packagesPath = '.packages', // TODO(zanderso): make this required and remove the default. + this.packagesPath = '.dart_tool/package_config.json', // TODO(zanderso): make this required and remove the default. this.nullSafetyMode = NullSafetyMode.sound, this.codeSizeDirectory, this.androidGradleDaemon = true, @@ -67,10 +67,10 @@ class BuildInfo { /// Mode-Flavor (e.g. Release-Paid). final String? flavor; - /// The path to the .packages file to use for compilation. + /// The path to the package configuration file to use for compilation. /// /// This is used by package:package_config to locate the actual package_config.json - /// file. If not provided, defaults to `.packages`. + /// file. If not provided, defaults to `.dart_tool/packages`. final String packagesPath; final List fileSystemRoots; diff --git a/packages/flutter_tools/lib/src/commands/test.dart b/packages/flutter_tools/lib/src/commands/test.dart index 4f99304a5d..fca00b4b39 100644 --- a/packages/flutter_tools/lib/src/commands/test.dart +++ b/packages/flutter_tools/lib/src/commands/test.dart @@ -378,8 +378,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts { collector = CoverageCollector( verbose: !machine, libraryPredicate: (String libraryName) => libraryName.contains(projectName), - packagesPath: globals.fs.file(buildInfo.packagesPath) - .parent.parent.childFile('.packages').path + packagesPath: buildInfo.packagesPath ); } diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index a27a9e20cc..b8cc1ce501 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -3001,8 +3001,9 @@ Future _ensureFlutterToolsSnapshot() async { 'cache', 'flutter_tools.snapshot', )); - final String dotPackages = globals.fs.path.absolute(globals.fs.path.join( - '.packages', + final String packageConfig = globals.fs.path.absolute(globals.fs.path.join( + '.dart_tool', + 'package_config.json' )); final File snapshotFile = globals.fs.file(flutterToolsSnapshotPath); @@ -3012,7 +3013,7 @@ Future _ensureFlutterToolsSnapshot() async { final List snapshotArgs = [ '--snapshot=$flutterToolsSnapshotPath', - '--packages=$dotPackages', + '--packages=$packageConfig', flutterToolsPath, ]; final ProcessResult snapshotResult = await Process.run( diff --git a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart index da89e132a2..590c65a030 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart @@ -106,8 +106,8 @@ void main() { ); } - const List pubOutput = [ - '.packages', + final List pubOutput = [ + globals.fs.path.join('.dart_tool', 'package_config.json'), 'pubspec.lock', ]; diff --git a/packages/flutter_tools/test/general.shard/build_info_test.dart b/packages/flutter_tools/test/general.shard/build_info_test.dart index 96f3976a42..220b787044 100644 --- a/packages/flutter_tools/test/general.shard/build_info_test.dart +++ b/packages/flutter_tools/test/general.shard/build_info_test.dart @@ -117,7 +117,7 @@ void main() { extraFrontEndOptions: ['--enable-experiment=non-nullable', 'bar'], extraGenSnapshotOptions: ['--enable-experiment=non-nullable', 'fizz'], bundleSkSLPath: 'foo/bar/baz.sksl.json', - packagesPath: 'foo/.packages', + packagesPath: 'foo/.dart_tool/package_config.json', codeSizeDirectory: 'foo/code-size', fileSystemRoots: ['test5', 'test6'], fileSystemScheme: 'scheme', @@ -149,7 +149,7 @@ void main() { extraFrontEndOptions: ['--enable-experiment=non-nullable', 'bar'], extraGenSnapshotOptions: ['--enable-experiment=non-nullable', 'fizz'], bundleSkSLPath: 'foo/bar/baz.sksl.json', - packagesPath: 'foo/.packages', + packagesPath: 'foo/.dart_tool/package_config.json', codeSizeDirectory: 'foo/code-size', // These values are ignored by toEnvironmentConfig androidProjectArgs: ['foo=bar', 'fizz=bazz'] @@ -164,7 +164,7 @@ void main() { 'EXTRA_FRONT_END_OPTIONS': '--enable-experiment=non-nullable,bar', 'EXTRA_GEN_SNAPSHOT_OPTIONS': '--enable-experiment=non-nullable,fizz', 'BUNDLE_SKSL_PATH': 'foo/bar/baz.sksl.json', - 'PACKAGE_CONFIG': 'foo/.packages', + 'PACKAGE_CONFIG': 'foo/.dart_tool/package_config.json', 'CODE_SIZE_DIRECTORY': 'foo/code-size', }); }); @@ -179,7 +179,7 @@ void main() { extraFrontEndOptions: ['--enable-experiment=non-nullable', 'bar'], extraGenSnapshotOptions: ['--enable-experiment=non-nullable', 'fizz'], bundleSkSLPath: 'foo/bar/baz.sksl.json', - packagesPath: 'foo/.packages', + packagesPath: 'foo/.dart_tool/package_config.json', codeSizeDirectory: 'foo/code-size', androidProjectArgs: ['foo=bar', 'fizz=bazz'] ); diff --git a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart index 1d396e1696..57965ed2fa 100644 --- a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart @@ -286,7 +286,6 @@ class TestFlutterTesterDevice extends FlutterTesterTestDevice { BuildMode.debug, '', treeShakeIcons: false, - packagesPath: '.dart_tool/package_config.json', ), hostVmServicePort: 1234, dartEntrypointArgs: dartEntrypointArgs, diff --git a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart index b8aa327eaf..24ad0e5fad 100644 --- a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart +++ b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart @@ -147,7 +147,7 @@ void main() { '--run-forever', '--non-interactive', '--enable-dart-profiling', - '--packages=.packages', + '--packages=.dart_tool/package_config.json', '--flutter-assets-dir=/.tmp_rand0/flutter_tester.rand0', '/.tmp_rand0/flutter_tester.rand0/flutter-tester-app.dill', ],