New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-4265] [SwiftPM] CURRENT_PROJECT_VERSION
should be defined on generated-xcodeproj
#5063
Comments
Should it actually try to infer a version number? CFBundleVersion isn't a compatibility version or anything, although it is supposed to be machine-parseable. |
`CURRENT_PROJECT_VERSION` is a build setting that `agvtool` operates on, but it mainly applies to authored Xcode projects. In the case of generated projects, I think it would make sense to use the package version for each target. It isn't clear what the right value is for the top-level package, though. |
I expect to fix on following scenario that creating new library package:
On above steps, version tag is not yet created. |
Quick help in Xcode's Build Settings view says that should be integer or float:
Which is correct? |
Xcode really only has two kinds of build settings: string and string list. It's definitely not a list, so it's stored as a string. That's what the "Value Type: String" means. But this particular build setting is then interpreted as a floating point number (of which an integer is just a special case, in the same way that `double f = 42` is the same as `double f = 42.0` in C). So I guess the correct way to think about it is that it's the string representation of a floating point number. |
I think the point was that floating-point numbers are not version strings, even numeric-only version strings. |
I see — I misunderstood the question as being whether `CURRENT_PROJECT_VERSION` stores a string or number. I don't know if this helps, but I think that because it stores a string value, it can actually contain a version value such as "1.2.3", despite what the documentation says. `agvtool` seems to operate on it correctly (e.g. `next-version` works as documented, though I don't know how interesting that behavior is in the case of packages). The unparsed string value makes its way into the `CFBundleVersion` key of the `Info,plist`, so I think it's still feasible to use the package number as the value of the `CURRENT_PROJECT_VERSION` setting. This probably also warrants a bug report on Xcode's documentation, since it seems that the value for `CURRENT_PROJECT_VERSION` follows the rules for the `CFBundleVersion` key, i.e. it's not just an "integer or floating point number" as the QuickHelp says. |
I've opened #2851 for this. Currently, it's just setting the version to 1, so that there is a value at least. A future improvement could e.g. use the current version of a package. |
|
Environment
swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-15-a
swift-DEVELOPMENT-SNAPSHOT-2017-03-15-a
Additional Detail from JIRA
md5: 97683a9b8e492477adf93de57734c991
relates to:
Issue Description:
SwiftPM generates `Info.plist` to library targets on generating Xcode project.
Those `Info.plist` contain `CFBundleVersion` key as following:
But, generated Xcode project does not have settings that defines `CURRENT_PROJECT_VERSION`, so framework target is build with emtpty `CFBundleVersion` key in their `Info.plist`.
If those frameworks are used on Apps, those are rejected on validation by iTunes connect with following error:
Xcode's template for framework target has settings that defining `CURRENT_PROJECT_VERSION` as `1` for avoiding such scenario.
SwiftPM should define `CURRENT_PROJECT_VERSION` as `1` on generating Xcode project as same as Xcode's template does.
The text was updated successfully, but these errors were encountered: