Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1332] Alloy.version does not match actual version

GitHub Issuen/a
Resolution Date2015-11-25T17:19:44.000+0000
Affected Version/salloy 1.7.27
Fix Version/sRelease 5.2.0, alloy 1.7.28
ReporterFokke Zandbergen
AssigneeFeon Sua Xin Miao


Alloy.version is [hard-coded](https://github.com/appcelerator/alloy/blob/master/Alloy/lib/alloy.js#L30) and not up to date with the actual version in [package.json](https://github.com/appcelerator/alloy/blob/master/package.json#L17). For sample apps I need to check that the user is using a supported Alloy version, which because of this I can not. I suggest we do a hacky RegEx replace [here](https://github.com/appcelerator/alloy/blob/master/Alloy/commands/compile/index.js#L164) or maybe better move [lib/alloy.js](https://github.com/appcelerator/alloy/blob/master/Alloy/lib/alloy.js) to the templates folder and properly replace a placeholder for the version with the one in package.json. That way we don't have to update the version in two places.


  1. Feon Sua Xin Miao 2015-11-24

    PR: https://github.com/appcelerator/alloy/pull/743 Functional Test: 1. Create a project 2. Print out Alloy.version from the controller, eg. index.js 3. The version should match package.json version.
  2. Feon Sua Xin Miao 2015-11-25

    PR merged.
  3. Eric Wieber 2016-01-20

    Verified fixed, using: MacOS 10.11.3 (15D21) Studio Ti SDK 5.2.0.v20160114021251 Appc NPM 4.2.3-1 Appc CLI 5.2.0-232 Alloy 1.7.33 Xcode 7.2 (7C68) Node v0.12.7 Java 1.7.0_80 Alloy.version now prints the correct version of the Alloy package. Used the provided steps to create and check a test case

JSON Source