{ "id": "118528", "key": "TIMOB-14884", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15691", "description": "2013 Sprint 19", "name": "2013 Sprint 19", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "15694", "description": "2013 Sprint 19 Core", "name": "2013 Sprint 19 Core", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-20T23:11:03.000+0000", "created": "2013-08-14T21:25:22.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [ { "id": "31075", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "117558", "key": "ALOY-760", "fields": { "summary": "Generate runtime files to Titanium platform-specific folders", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "31076", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "118478", "key": "ALOY-783", "fields": { "summary": "Alloy: config.json environment-specific global values are ignored, always returning the env:development value", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "31580", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "117712", "key": "TIMOB-14683", "fields": { "summary": "CLI: Titanium fails to build when only platform-specific app.js is present", "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": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2013-12-19T20:09:27.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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. problem\r\n\r\nWhen referencing commonjs modules in code, iOS device builds do not reference platform specific modules if they are present, instead they reference the non-platform-specific ones. This does not occur on iOS simulator builds, which behave as expected. This makes it impossible to use platform-specific versions of Javascript files on iOS device builds, being a blocker for the linked tickets.\r\n\r\nh2. test case\r\n\r\nh4. app.js\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff',\r\n\tmodal: false,\r\n\texitOnClose: true\r\n});\r\n\r\nwin.open();\r\n\r\nrequire('lib/mylib').sayHello();\r\n{code}\r\n\r\nh4. lib/mylib.js\r\n{code:javascript}\r\nexports.sayHello = function() {\r\n\talert('hello from the CFG.js (you should never see this)');\r\n}\r\n{code}\r\n\r\nh4. iphone/lib/mylib.js\r\n{code:javascript}\r\nexports.sayHello = function() {\r\n\talert('hello from the iphone CFG.js');\r\n}\r\n{code}\r\n\r\nh2. reproduce\r\n\r\n# Create a traditional titanium app, adding the files mentioned above.\r\n# Run for iOS simulator\r\n# Confirm that you get the message from the platform-specific mylib.js file: \"hello from the iphone CFG.js\"\r\n# Now run for an iOS device\r\n# You will get the error described here, where the non-platform-specific module is referenced, giving you the message: \"hello from the CFG.js (you should never see this)\"", "attachment": [], "flagged": false, "summary": "iOS: device builds don't use platform-specific files for commonjs modules", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "270015", "author": { "name": "troscoe", "key": "troscoe", "displayName": "Tristan Roscoe", "active": true, "timeZone": "America/New_York" }, "body": "This works for iPhone, not pretty though:\r\nalloy compile --config platform=ios && cp -r Resources/iphone/* Resources && ti build --platform ios -T device\r\n\r\nOSX 10.8.4\r\nXcode Version 5.0 (5A11386k)\r\nTitanium CLI 3.1.2\r\nAlloy 1.3.0\r\nSDK 3.1.2.GA", "updateAuthor": { "name": "troscoe", "key": "troscoe", "displayName": "Tristan Roscoe", "active": true, "timeZone": "America/New_York" }, "created": "2013-09-06T19:21:52.000+0000", "updated": "2013-09-06T19:21:52.000+0000" }, { "id": "270016", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just to explain [~troscoe]'s comment a bit, it is relative to Alloy 1.3.0 which uses platform-specific compiles (ALOY-760). Due to this ticket, these don't work properly for iOS device builds. His steps workaround this issue by:\n\n# Compiling Alloy for ios, putting files in platform-specific folder\n# Copy the platform-specific files to top-level Resources folder. This won't conflict with other platforms since their platform-specific folders behave as expected and will override these.\n# Run a titanium build, which will compile alloy to the platform-specific folder again. These will be ignored and the files copied in the last step will be used by the Titanium build process. ", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-06T19:35:54.000+0000", "updated": "2013-09-06T19:35:54.000+0000" }, { "id": "272296", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Pull request: https://github.com/appcelerator/titanium_mobile/pull/4723", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2013-09-21T00:49:00.000+0000", "updated": "2013-09-21T00:49:00.000+0000" }, { "id": "276062", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified the \"hello from the iphone CFG.js\" alert is appearing on iOS device when adding lib/mylib.js and iphone/lib/mylib.js to the specified directory.\n\nTested on:\n\nTitanium Studio, build: 3.2.0.201310181940\nOS: Mac OS X Mountain Lion (10.8.5)\nSDK build: 3.2.0.v20131021142445\nTi CLI: 3.2.0 (72f7426b4ee6c2d2883c666d5b7e03906a16012f)\nDevices: iphone 4s (6.0.1), iphone 5 (7.0.2)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-21T23:52:32.000+0000", "updated": "2013-10-21T23:52:32.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }