[TIMOB-26821] CLI: Use <version> for the "android:versionCode" attribute
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | cb-tooling |
Reporter | Hans Knöchel |
Assignee | Unknown |
Created | 2019-02-12T21:18:03.000+0000 |
Updated | 2020-01-30T23:09:27.000+0000 |
Description
The tag of the tiapp.xml can be used to bump build versions in production builds on iOS and it works great. Unfortunately, right now, Android still always needs to update the
android:versionCode
attribute of the <application>
node everytime.
It would be great if the build could auto-bump it for production builds as well.
Currently, Titanium is already assigning the "tiapp.xml"
<version/>
string to the Android app's "versionName" attribute within the "AndroidManifest.xml". But the problem with the Android "versionCode" is that it only supports a single integer. Android apps do not support the typical "major.minor.build" versioning scheme. Only a single integer is supported. So, it's up to the app developer to decide how to handle it. Note that a common handling of the "versionCode" integer is to treat it as a *fixed-point* type. For example, you can spec it out on your end that the least 2 significant digits in the integer (ie: the 2 right most digits) are decimal so that integer value100
should be regarded as1.0
. That is, the formula would be:floatVersion = versionCode / 100.0
(I don't recommend that you turn the version into a literal float since you would run into precision issues.) Just note that since there are no rules and every app developer handles "versionCode" differently, we can't really doing anything automatic for app developers because whatever scheme we dictate may not line-up with their own scheme.