Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13869] CLI: Version in tiapp.xml is stripped to a maximum of 3 dot separated groups

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-03-30T21:22:15.000+0000
Affected Version/sRelease 3.0.2, Release 3.1.0
Fix Version/sn/a
ComponentsCLI
Labelsft
ReporterMihai Bojin
AssigneeChris Barber
Created2013-05-15T11:36:31.000+0000
Updated2017-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);

Comments

  1. Chris Barber 2013-06-05

    @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.
  2. Ingo Muschenetz 2013-10-31

    Awaiting better guidance on how to solve this. Bumping to 3.2.1.
  3. Ingo Muschenetz 2014-04-28

    Out of bandwidth for 3.3.0. Bumping to next version.
  4. Ingo Muschenetz 2014-08-12

    [~cbarber] believes this might be fixed with 3.3.0. Can we confirm?
  5. Tim Poulsen 2014-08-20

    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:
       <key>CFBundleVersion</key>
       <string>1.2.3.1000</string>
       <key>CFBundleShortVersionString</key>
       <string>1.2.3</string>
       
  6. Lee Morris 2017-03-30

    Closing ticket as I am unable to reproduce the issue.

JSON Source