[TIMOB-19173] Tiapp: Add <build> element to set CFBundleVersion and android:versionCode
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 4.1.0 |
| Fix Version/s | n/a |
| Components | Android, iOS |
| Labels | cb-tooling, titaniumlib |
| Reporter | Fokke Zandbergen |
| Assignee | Chris Barber |
| Created | 2015-07-06T11:54:12.000+0000 |
| Updated | 2020-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.
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.
For both the new
<build>and the existing<version>we need to fix thatTi.App.versionandTi.App.builddo not use the platform-specific build and release versions when set in the<android>and<ios>sections. TIMOB-18909Is there an alternative for this on recent Ti releases?
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
[~ygbr] As Titanium will default
CFBundleShortVersionStringandandroid:versionNameto<version>you don't need to set these (as long as both platforms are on the same version). To incrementCFBundleVersionandandroid:versionCodeI normally use a Grunt/Gulp script each time I build. The same script could then also write that version toapp/config.jsonfor use in the app. But of course resolving this ticket would make it easier.up!