{ "id": "118478", "key": "ALOY-783", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15402", "description": "Alloy 1.2.0, concurrent with SDK 3.1.0", "name": "Alloy 1.2.0", "archived": false, "released": true, "releaseDate": "2013-08-15" }, { "id": "15601", "description": "2013 Sprint 17", "name": "2013 Sprint 17", "archived": true, "released": true, "releaseDate": "2013-08-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-14T23:52:21.000+0000", "created": "2013-08-14T07:03:36.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "qe-3.1.2", "qe-testadded", "regression" ], "versions": [ { "id": "15402", "description": "Alloy 1.2.0, concurrent with SDK 3.1.0", "name": "Alloy 1.2.0", "archived": false, "released": true, "releaseDate": "2013-08-15" }, { "id": "15601", "description": "2013 Sprint 17", "name": "2013 Sprint 17", "archived": true, "released": true, "releaseDate": "2013-08-23" } ], "issuelinks": [ { "id": "31076", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "outwardIssue": { "id": "118528", "key": "TIMOB-14884", "fields": { "summary": "iOS: device builds don't use platform-specific files for commonjs modules", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-08-15T22:56:04.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "h5. Problem description\r\nEnvironment specific global values are not respected, the value returned is always the one relative to the 'env:development'\r\n\r\nh5. Steps to reproduce\r\n1. Run the sample code\r\n\r\nh6. config.json\r\n{code}\r\n{\r\n\t\"global\": {\r\n\t\t\"key\": \"defaultValue\",\r\n\t\t\"anotherKey\": 12345\r\n\t},\r\n\t\"env:development\": {\r\n\t\t\"environment\": \"development\"\r\n\t},\r\n\t\"env:test\": {\r\n\t\t\"environment\": \"test\"\r\n\t},\r\n\t\"env:production\": {\r\n\t\t\"environment\": \"production\"\r\n\t},\r\n\t\"os:ios\": {\r\n\t\t\"key\": \"iosValue\"\r\n\t},\r\n\t\"os:android\": {\r\n\t\t\"key\": \"androidValue\"\r\n\t},\r\n\t\"dependencies\": {}\r\n}\r\n{code}\r\n\r\nh6. index.xml\r\n{code}\r\n\r\n \r\n \r\n \t\r\n \t\r\n \t\r\n \r\n \r\n\r\n{code}\r\n\r\nh6. index.js\r\n{code}\r\n// Alloy.Globals.someGlobalObject = { key: 'value' };\r\n\r\n$.label1.text = $.label1.text + ' ' + Alloy.CFG.key;\r\n$.label2.text = $.label2.text + ' ' + Alloy.CFG.anotherKey;\r\n$.label3.text = $.label3.text + ' ' + Alloy.CFG.environment;\r\n\r\n\r\nif ((Alloy.isHandheld) && (OS_IOS)){\r\n\talert('iphone handheld!')\r\n}\r\nelse if ((Alloy.isHandheld) && (OS_ANDROID)){\r\n\talert('android handheld')\r\n}\r\nelse if ((Alloy.isTablet)&&(OS_IOS)){\r\n\talert('ipad tablet!')\r\n}\r\nelse if ((Alloy.isTablet)&&(OS_ANDROID)){\r\n\talert('android tablet')\r\n}\r\nelse if (OS_MOBILEWEB){\r\n\talert('mobileweb!')\r\n}\r\nelse {\r\n\talert(\"I don't know!'\")\r\n}\r\n\r\n$.win.open();\r\n\r\n{code}\r\n\r\n2. Build for packaging (tested on Android)\r\n3. Install the package on device and run the app\r\n\r\nResult: 'environment: development' label is displayed\r\nExpected result: \"environment: production\" label should be displayed.\r\n\r\nh5. Note\r\nThis is not reproducible on Alloy 1.1.3, so is a regression.", "attachment": [], "flagged": false, "summary": "Alloy: config.json environment-specific global values are ignored, always returning the env:development value", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.2.v20130812225629\r\nAlloy 1.2.0-alpha6\r\nAppcelerator Studio 3.1.2.201308091728\r\nCLI 3.1.2-alpha\r\nNode 0.10.13\r\nLiveView: 0.1.32", "comment": { "comments": [ { "id": "266422", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Notes so far:\n\nI am able to see this problem even on 1.1.3, doing both test and production builds, they always show up as development. I've also tried various versions of the CLI (3.1.0-3.2.0) and the TiSDK. All behave the same way for android builds. \n\nIn perusing the CLI android build command code, it appears that the deploy type is never actually set. Unfortunately, due to the way the CLI is structured, this appears to be a change that needs to be made in the TiSDK, not the CLI node module. \n\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/cli/commands/_build.js\n\nIf you look in the above file you'll see that \"deploy-type\" is not implemented as an option (it's commented out). In addition, when specifying a device build, you'd use the \"--target, -T\" option, which does not modify the deploy type in anyway. In fact, as Federico confirmed with the packaging test, no where in the _build.js file does it appear that the deploy type is taken into account. The \"deployTypes\" defined at the top of the file appear to be unused.\n\nThis appears to be a TIMOB CLI issue, but I will need to confirm with [~fcasali].", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T15:57:27.000+0000", "updated": "2013-08-14T15:57:27.000+0000" }, { "id": "266477", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/alloy/pull/221\r\n\r\n[~fcasali] can you test this against the test app you laid out in the ticket here and make sure that it behaves as expected for all builds? Please install alloy with the following command:\r\n\r\n{code}\r\nsudo npm install -g git://github.com/appcelerator/alloy.git#1_2_X\r\n{code}", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T19:46:28.000+0000", "updated": "2013-08-14T19:46:28.000+0000" }, { "id": "266520", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening to address issue with CFG.js not updating when deploy type changes. Also is affected by TIMOB-14884.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T21:28:33.000+0000", "updated": "2013-08-14T21:28:33.000+0000" }, { "id": "266531", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/alloy/pull/222\n\n[~fcasali] try all the tests again. All mentioned issues should now pass when installing from the 1_2_X branch as mentioned above.\n\n{code}\nsudo npm install -g git://github.com/appcelerator/alloy.git#1_2_X\n{code}", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T22:09:56.000+0000", "updated": "2013-08-14T22:09:56.000+0000" }, { "id": "266583", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed as resolved. Pushed alloy 1.2.0-beta as a result.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-14T23:52:21.000+0000", "updated": "2013-08-14T23:52:21.000+0000" }, { "id": "266783", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed. \nEnvironment specific global variables are returned correctly depending on the deploy.\n\nTitanium SDK 3.1.2.v20130814124556\nAlloy 1.2.0-beta\nAppcelerator Studio 3.1.2.201308091728\nCLI 3.1.2-alpha\nNode 0.10.13\n\nAndroid, iOS and MobileWeb\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-15T22:55:45.000+0000", "updated": "2013-08-15T22:55:45.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }