From 14759dc5a488cff461476c0523587c3dd5e7dab5 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 22 Apr 2021 09:39:39 -0700 Subject: [PATCH] Revert "[flutter_tools] pin transitive deps during --transitive-closure (#80911)" (#80959) This reverts commit c2aa193c5fb723ccf3ee80ceed08e5060ca7463f. --- dev/bots/allowlist.dart | 9 +--- dev/bots/analyze.dart | 2 +- .../lib/src/commands/update_packages.dart | 41 +++++-------------- 3 files changed, 14 insertions(+), 38 deletions(-) diff --git a/dev/bots/allowlist.dart b/dev/bots/allowlist.dart index 535b7ac952..9b1b016f9e 100644 --- a/dev/bots/allowlist.dart +++ b/dev/bots/allowlist.dart @@ -18,6 +18,7 @@ const Set kCorePackageAllowList = { 'collection', 'fake_async', 'file', + 'frontend_server_client', 'intl', 'meta', 'path', @@ -72,11 +73,5 @@ const Set kCorePackageAllowList = { 'flutter_driver', 'flutter_localizations', 'flutter_test', - 'integration_test', - 'flutter_goldens', - 'flutter_goldens_client', - 'fuchsia_remote_debug_protocol', - 'platform', - 'process', - 'sky_engine', + 'integration_test' }; diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index cae1d65fb7..429b9b37b6 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -1173,7 +1173,7 @@ Future _checkConsumerDependencies() async { // Do not change this signature without following the directions in // dev/bots/allowlist.dart - const String kExpected = 'QnuXnTSwemf+qT+LAU8K8Bb0l9L20z4qT1PUEQlBrVg='; + const String kExpected = 'nkO7DCjvSMB6VKyw+V9MU46m3xFEk/oYSbmgAWqvbXE='; if (disallowed.isNotEmpty) { exitWithError([ diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index cefddf6a3d..0204ba529a 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -196,41 +196,22 @@ class UpdatePackagesCommand extends FlutterCommand { '--force-upgrade cannot be used with the --offline flag' ); } - if (isConsumerOnly && !isPrintTransitiveClosure) { - throwToolExit( - '--consumer-only can only be used with the --transitive-closure flag' - ); - } // "consumer" packages are those that constitute our public API (e.g. flutter, flutter_test, flutter_driver, flutter_localizations, integration_test). - if (isPrintTransitiveClosure) { - // Only retain flutter, flutter_test, flutter_driver, and flutter_localizations. - const List consumerPackages = ['flutter', 'flutter_test', 'flutter_driver', 'flutter_localizations', 'integration_test']; - - final PubDependencyTree tree = PubDependencyTree(); - for (final Directory package in packages) { - final String packageName = globals.fs.path.basename(package.path); - if (!consumerPackages.contains(packageName) && isConsumerOnly) { - continue; - } - await pub.batch( - ['get'], - context: PubContext.updatePackages, - directory: package.path, - retry: false, // errors here are usually fatal since we're not hitting the network - ); - await pub.batch( - ['deps', '--style=compact'], - context: PubContext.updatePackages, - directory: package.path, - filter: tree.fill, - retry: false, // errors here are usually fatal since we're not hitting the network + if (isConsumerOnly) { + if (!isPrintTransitiveClosure) { + throwToolExit( + '--consumer-only can only be used with the --transitive-closure flag' ); } - tree._dependencyTree.forEach((String from, Set to) { - globals.printStatus('$from -> $to'); + // Only retain flutter, flutter_test, flutter_driver, and flutter_localizations. + const List consumerPackages = ['flutter', 'flutter_test', 'flutter_driver', 'flutter_localizations', 'integration_test']; + // ensure we only get flutter/packages + packages.retainWhere((Directory directory) { + return consumerPackages.any((String package) { + return directory.path.endsWith('packages${globals.fs.path.separator}$package'); + }); }); - return FlutterCommandResult.success(); } if (isVerifyOnly) {