Build number (part after +) is documented as optional, use entire app version if not present (#37036)

This commit is contained in:
Jenn Magder
2019-07-31 16:18:09 -07:00
committed by GitHub
parent fb2f3e580e
commit dd1fb3bcb7
4 changed files with 48 additions and 3 deletions

View File

@@ -152,12 +152,17 @@ List<String> _xcodeBuildSettingsLines({
xcodeBuildSettings.add('FLUTTER_FRAMEWORK_DIR=$frameworkDir');
}
final String buildName = validatedBuildNameForPlatform(TargetPlatform.ios, buildInfo?.buildName ?? project.manifest.buildName);
final String buildNameToParse = buildInfo?.buildName ?? project.manifest.buildName;
final String buildName = validatedBuildNameForPlatform(TargetPlatform.ios, buildNameToParse);
if (buildName != null) {
xcodeBuildSettings.add('FLUTTER_BUILD_NAME=$buildName');
}
final String buildNumber = validatedBuildNumberForPlatform(TargetPlatform.ios, buildInfo?.buildNumber ?? project.manifest.buildNumber);
String buildNumber = validatedBuildNumberForPlatform(TargetPlatform.ios, buildInfo?.buildNumber ?? project.manifest.buildNumber);
// Drop back to parsing build name if build number is not present. Build number is optional in the manifest, but
// FLUTTER_BUILD_NUMBER is required as the backing value for the required CFBundleVersion.
buildNumber ??= validatedBuildNumberForPlatform(TargetPlatform.ios, buildNameToParse);
if (buildNumber != null) {
xcodeBuildSettings.add('FLUTTER_BUILD_NUMBER=$buildNumber');
}