warn about hard-coded version constraints in the upgrade script (#14291)

This commit is contained in:
Yegor 2018-01-26 12:41:09 -08:00 committed by GitHub
parent c11f174946
commit 4c21bf103a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<PubspecDependency> 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');