@@ -109,7 +109,7 @@ class VersionCheckCommand extends PluginCommand {
109
109
@override
110
110
final String description =
111
111
'Checks if the versions of the plugins have been incremented per pub specification.\n '
112
- 'Also checks if the version in CHANGELOG matches the version in pubspec.\n\n '
112
+ 'Also checks if the latest version in CHANGELOG matches the version in pubspec.\n\n '
113
113
'This command requires "pub" and "flutter" to be in your path.' ;
114
114
115
115
@override
@@ -147,7 +147,7 @@ class VersionCheckCommand extends PluginCommand {
147
147
final String error = '$pubspecPath incorrectly updated version.\n '
148
148
'HEAD: $headVersion , master: $masterVersion .\n '
149
149
'Allowed versions: $allowedNextVersions ' ;
150
- PrintErrorAndExit (errorMessage: error);
150
+ printErrorAndExit (errorMessage: error);
151
151
}
152
152
153
153
bool isPlatformInterface = pubspec.name.endsWith ("_platform_interface" );
@@ -156,7 +156,7 @@ class VersionCheckCommand extends PluginCommand {
156
156
NextVersionType .BREAKING_MAJOR ) {
157
157
final String error = '$pubspecPath breaking change detected.\n '
158
158
'Breaking changes to platform interfaces are strongly discouraged.\n ' ;
159
- PrintErrorAndExit (errorMessage: error);
159
+ printErrorAndExit (errorMessage: error);
160
160
}
161
161
} on io.ProcessException {
162
162
print ('Unable to find pubspec in master for $pubspecPath .'
@@ -181,7 +181,7 @@ class VersionCheckCommand extends PluginCommand {
181
181
final Pubspec pubspec = _tryParsePubspec (plugin);
182
182
if (pubspec == null ) {
183
183
final String error = 'Cannot parse version from pubspec.yaml' ;
184
- PrintErrorAndExit (errorMessage: error);
184
+ printErrorAndExit (errorMessage: error);
185
185
}
186
186
final Version fromPubspec = pubspec.version;
187
187
@@ -191,10 +191,7 @@ class VersionCheckCommand extends PluginCommand {
191
191
String firstLineWithText;
192
192
final Iterator iterator = lines.iterator;
193
193
while (iterator.moveNext ()) {
194
- final String currentStriptEmptySpaces =
195
- (iterator.current as String ).replaceAll (' ' , '' );
196
- if (currentStriptEmptySpaces != null &&
197
- currentStriptEmptySpaces.isNotEmpty) {
194
+ if ((iterator.current as String ).trim ().isNotEmpty) {
198
195
firstLineWithText = iterator.current;
199
196
break ;
200
197
}
@@ -204,8 +201,8 @@ class VersionCheckCommand extends PluginCommand {
204
201
Version fromChangeLog = Version .parse (versionString);
205
202
if (fromChangeLog == null ) {
206
203
final String error =
207
- 'Cannot find version on the first line of CHANGELOG.md' ;
208
- PrintErrorAndExit (errorMessage: error);
204
+ 'Cannot find version on the first line of ${ plugin . path }/ CHANGELOG.md' ;
205
+ printErrorAndExit (errorMessage: error);
209
206
}
210
207
211
208
if (fromPubspec != fromChangeLog) {
@@ -214,7 +211,7 @@ versions for $packageName in CHANGELOG.md and pubspec.yaml do not match.
214
211
The version in pubspec.yaml is $fromPubspec .
215
212
The first version listed in CHANGELOG.md is $fromChangeLog .
216
213
''' ;
217
- PrintErrorAndExit (errorMessage: error);
214
+ printErrorAndExit (errorMessage: error);
218
215
}
219
216
print ('${packageName } passed version check' );
220
217
}
@@ -227,13 +224,13 @@ The first version listed in CHANGELOG.md is $fromChangeLog.
227
224
if (pubspec == null ) {
228
225
final String error =
229
226
'Failed to parse `pubspec.yaml` at ${pubspecFile .path }' ;
230
- PrintErrorAndExit (errorMessage: error);
227
+ printErrorAndExit (errorMessage: error);
231
228
}
232
229
return pubspec;
233
230
} on Exception catch (exception) {
234
231
final String error =
235
232
'Failed to parse `pubspec.yaml` at ${pubspecFile .path }: $exception }' ;
236
- PrintErrorAndExit (errorMessage: error);
233
+ printErrorAndExit (errorMessage: error);
237
234
}
238
235
return null ;
239
236
}
0 commit comments