From 4c21bf103a0de1dddc98429668ff10a1f0359fc0 Mon Sep 17 00:00:00 2001 From: Yegor Date: Fri, 26 Jan 2018 12:41:09 -0800 Subject: [PATCH] warn about hard-coded version constraints in the upgrade script (#14291) --- .../lib/src/commands/update_packages.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index fe91a413f29..7df9ae689f8 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -867,6 +867,17 @@ File _pubspecFor(Directory directory) { /// Generates the source of a fake pubspec.yaml file given a list of /// dependencies. String _generateFakePubspec(Iterable dependencies) { + if (_kManuallyPinnedDependencies.isNotEmpty) { + final String hardCodedConstraints = _kManuallyPinnedDependencies.keys + .map((String packageName) { + return ' - $packageName: ${_kManuallyPinnedDependencies[packageName]}'; + }) + .join('\n'); + printStatus( + 'WARNING: the following packages use hard-coded version constraints:\n' + '$hardCodedConstraints', + ); + } final StringBuffer result = new StringBuffer(); final StringBuffer overrides = new StringBuffer(); result.writeln('name: flutter_update_packages');