Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19173] Tiapp: Add <build> element to set CFBundleVersion and android:versionCode

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 4.1.0
Fix Version/sn/a
ComponentsAndroid, iOS
Labelscb-tooling, titaniumlib
ReporterFokke Zandbergen
AssigneeChris Barber
Created2015-07-06T11:54:12.000+0000
Updated2020-03-06T21:35:48.000+0000

Description

I'm preparing a blog post about versioning your apps now TIMOB-17993 has been resolved in 4.1.0: https://gist.github.com/FokkeZB/f7ae3ab57eb8185a338d. Read the draft as context for this ticket. It's great that developers can now manually set the CFBundleVersion as they could android:versionCode. However, I think we can improve the workflow by introducing a <build> element that wants an integer value that will be used for both CFBundleVersion and android:versionCode (and other - Windows - platform's build versions) unless the developer has set these manually of course.
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <id>com.appcelerator.myapp</id>
    <name>MyApp</name>
    <version>1.1.0</version>
    <build>123</build>
Some other subtasks would follow out this as well if we decide to do this: * Expose the new element in the TiApp Editor in Studio. * Expose the value via Ti.App.build in the SDK (TIMOB-18909). * <version> should be used for the release version as-is and not [truncated](https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L2080), leaving it up to the developer.

Comments

  1. Fokke Zandbergen 2015-07-06

    This would make TISTUD-5088 not needed anymore, saving the Editor from becoming too complicated, even more since we then should also expose CFBundleVersion and CFBundleShortVersionString as well.
  2. Fokke Zandbergen 2015-07-06

    For both the new <build> and the existing <version> we need to fix that Ti.App.version and Ti.App.build do not use the platform-specific build and release versions when set in the <android> and <ios> sections. TIMOB-18909
  3. Ygor Lemos 2016-05-23

    Is there an alternative for this on recent Ti releases?
  4. Fokke Zandbergen 2016-05-23

    Would these help you atm? * http://docs.appcelerator.com/platform/latest/#!/api/Titanium-property-buildHash * http://docs.appcelerator.com/platform/latest/#!/api/Titanium-property-buildDate
  5. Ygor Lemos 2016-05-23

  6. Fokke Zandbergen 2016-05-24

    [~ygbr] As Titanium will default CFBundleShortVersionString and android:versionName to <version> you don't need to set these (as long as both platforms are on the same version). To increment CFBundleVersion and android:versionCode I normally use a Grunt/Gulp script each time I build. The same script could then also write that version to app/config.json for use in the app. But of course resolving this ticket would make it easier.
  7. Ygor Lemos 2019-01-15

    up!

JSON Source