Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18431] TiAPI: Ti.getVersion returns only the first 3 digits of the version

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2015-06-12T01:16:59.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsiOS
Labelsn/a
ReporterEduardo Gomez
AssigneeChee Kiat Ng
Created2015-01-22T18:39:26.000+0000
Updated2015-06-23T17:52:18.000+0000

Description

Issue Description

With the 3.5.0.GA TiSDK the Ti.getVersion() function only returns the first 3 digits of the TiSDK so it returns 3.5.0 even though its using a custom SDK like 3.5.0.GA.FIS TiSDK. It would be great to have this fixed in the next Maintenance release like 3.5.1 if possible.

Test Case

(function() { 

Ti.API.error("Get Version: " + Ti.getVersion()); 

})(); 

Console Output

[INFO] :   Test/1.0 (3.5.0.0014f83)
[INFO] :   [object ComAppceleratorApmModule] loaded
[INFO] :   Get Version: 3.5.0

Comments

  1. Alan Leard 2015-01-26

    What is the reason why we wouldn't return the full version number? The developer can always choose to truncate.
  2. Rick Blalock 2015-01-26

    So its not a regression then? What was the reasoning for the change?
  3. Malcolm Hollingsworth 2015-02-09

    It must be more work to NOT return the original value - please sir can I have my revision code back.
  4. Ingo Muschenetz 2015-02-09

    Okay, this seems like we should do this based on feedback. Does this apply to Android as well?
  5. Ashraf Abu 2015-05-22

    Just to note: Both iOS and Android returns 3 digits currently.
  6. Chee Kiat Ng 2015-06-03

    Ti.getVersion returns the version number based on the file here */build/titanium_version.py* in the titanium_mobile repo. This has been tested on the latest master branch on iOS and Android. Basically, for any custom SDK built based on our titanium_mobile, you just have to change the version string in this file, execute scons to compile, subsequently calling this method based on the packaged build, will return the custom version string. We will not make any changes to our usual convention of putting a 3 digit string here, so as not to cause behavior change. Developers who needs this for their customised SDK can just use the method I described here.
  7. Chee Kiat Ng 2015-06-09

    If this is acceptable, will be closing ticket on Friday 12 June.

JSON Source