Repository navigation
Warn when build number and version can't be parsed on iOS - #40611
Conversation
Codecov Report
@@ Coverage Diff @@
## master #40611 +/- ##
==========================================
+ Coverage 58.53% 59.36% +0.83%
==========================================
Files 192 192
Lines 18672 18683 +11
==========================================
+ Hits 10929 11092 +163
+ Misses 7743 7591 -152
Continue to review full report at Codecov.
|
stuartmorgan-g
left a comment
There was a problem hiding this comment.
LGTM; one optional nit.
There was a problem hiding this comment.
Is is useful to handle this separately? It seems like making the below non-else ifs and just having two lines of output would be as easy to understand, and less code.
There was a problem hiding this comment.
I had that at first because it was much easier to write, but I decided to combine it to give a nicer message. Here's the difference in output. Current code:
Signing iOS app for device deployment using developer identity: "..."
Warning: Missing build name (CFBundleShortVersionString), defaulting to 1.0.0.
Missing build number (CFBundleVersion), defaulting to 1.
Set a build name and number in the pubspec.yaml version before submitting to the App Store.vs your suggestion:
Signing iOS app for device deployment using developer identity: "..."
Warning: Missing build name (CFBundleShortVersionString), defaulting to 1.0.0.
Set a build name in the pubspec.yaml version before submitting to the App Store.
Warning: Missing build number (CFBundleVersion), defaulting to 1.
Set a build number in the pubspec.yaml version before submitting to the App Store.
What do you think?
There was a problem hiding this comment.
I actually prefer the second; I think it makes it clearer that there are two distinct issues that need to be resolved. It's clearly subjective though, so your call.
There was a problem hiding this comment.
How about:
if (buildNameIsMissing) {
printError('Warning: Missing build name (CFBundleShortVersionString), defaulting to $defaultBuildName.');
}
if (buildNumberIsMissing) {
printError('Warning: Missing build number (CFBundleVersion), defaulting to $defaultBuildNumber.\n');
}
if (buildNameIsMissing || buildNumberIsMissing) {
printError('Action Required: You must set a build name and number in the pubspec.yaml '
'file before submitting to the App Store.');
}There was a problem hiding this comment.
Sounds good. I added "version field" just so they knew how to add the name and number:
printError('Action Required: You must set a build name and number in the pubspec.yaml '
'file version field before submitting to the App Store.');97fc238 to
c3a7322
Compare


Description
Build number and build version are required on iOS. Fall back to default values if one can't be parsed from the pubspec version, but warn that they need to set one before submitting to the App Store.
Related Issues
Fixes #38610.
See also #37036.
Tests
Updated xcodeproj_test.
Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change