[TIMOB-13869] CLI: Version in tiapp.xml is stripped to a maximum of 3 dot separated groups
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2017-03-30T21:22:15.000+0000 |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | CLI |
Labels | ft |
Reporter | Mihai Bojin |
Assignee | Chris Barber |
Created | 2013-05-15T11:36:31.000+0000 |
Updated | 2017-03-30T21:23:07.000+0000 |
Description
If specifying a version including a build number as well, ie in tiapp.xml:
<version>1.2.3.1000</version>
When building the project with 'titanium build', the Info.plist that gets generated will only contain a maximum of 3 groups, ie:
<key>CFBundleShortVersionString</key>
<string>1.2.3</string>
<key>CFBundleVersion</key>
<string>1.2.3</string>
In fact the resulting plist should contain something like:
<key>CFBundleShortVersionString</key>
<string>1.2.3</string>
<key>CFBundleVersion</key>
<string>1.2.3.1000</string>
This is useful to identify the build number in the final installed app.
This can be fixed in: iphone/cli/commands/_build.js
plist.CFBundleVersion = appc.version.format(this.tiapp.version, 3, 3);
should in fact be:
plist.CFBundleVersion = appc.version.format(this.tiapp.version, 3, 4);
@Mihai, we strip the version to 3 numbers based on the requirements defined by Apple. They explicitly state: {quote} The build version number should be a string comprised of three non-negative, period-separated integers with the first integer being greater than zero. The string should only contain numeric (0-9) and period (.) characters. Leading zeros are truncated from each integer and will be ignored (that is, 1.02.3 is equavalent to 1.2.3). This key is not localizable. {quote} Link: https://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102364-TPXREF106 I could add a CLI config setting that allows you to override this or possibly just allow it for non-distribution/production builds, but I guess I don't fully understand why it matters setting it in the CFBundleVersion. You can set whatever version you want in the tiapp.xml and it'll show up identically in the Ti.app.version property.
Awaiting better guidance on how to solve this. Bumping to 3.2.1.
Out of bandwidth for 3.3.0. Bumping to next version.
[~cbarber] believes this might be fixed with 3.3.0. Can we confirm?
With 3.3.0.GA, the CFBundleVersion preserves the four version parts. Here's what I did: 1. Used
ti create
to create a new Classic project 2. Edited the tiapp.xml to set version number to 1.2.3.1000 3. Built for the iOS simulator 4. Opened build/iphone/Info.plist, which shows:Closing ticket as I am unable to reproduce the issue.