SwiftInfo
SwiftInfo copied to clipboard
Extracting version numbers breaks on Xcode 11
After upgrading to to version 11, Xcode moved the version numbers from Info.plist
into the project file. This leads to this new confusing header from SwiftInfo:
SwiftInfo results for SuperApp $(MARKETING_VERSION) ($(CURRENT_PROJECT_VERSION)) - Release:
That really sucks... I haven't seen this because we keep our versions in a separate file, but for now, a way to avoid this is to parse and send the version values manually in the project info:
let projectInfo = ProjectInfo(xcodeproj: "./iFood/iFood.xcodeproj",
target: "iFoodApp",
configuration: isInPullRequestMode ? "Testing": "Release",
plistPath: "./iFood/Resources/Info.plist",
versionString: versionString,
buildNumber: buildNumber)
We also keep the app version and build number in a separate file, but SwiftInfo could do this heavy lifting for the user probably. In our case, we use an identifier in those fields, and set a value in INFOPLIST_PREFIX_HEADER
in the Build Settings pointing to the file where those identifiers are kept. SwiftInfo could read this value (a filepath), open the file and look for the identifiers, to find its value 😇
Just not sure if this fix would be "generic enough" - it'd work in our project, but idk if other projects have other types of setup that don't use INFOPLIST_PREFIX_HEADER
🤔