{ "id": "153499", "key": "ALOY-1336", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-03-15T21:41:51.000+0000", "created": "2015-11-30T11:48:07.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Settings.bundle", "platform", "themes" ], "versions": [], "issuelinks": [ { "id": "50088", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "153727", "key": "TISTUD-7908", "fields": { "summary": "platform/iphone/settings.bundle in themes does not override platform/iphone/settings.bundle", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "50010", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "121538", "key": "ALOY-858", "fields": { "summary": "Alloy: Theme \"i18n\" and \"platform\" folders", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "54565", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "155573", "key": "ALOY-1365", "fields": { "summary": "Improve how Alloy works with i18n and platform 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": "Critical", "id": "1" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "50705", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "152042", "key": "ALOY-1318", "fields": { "summary": "DefaultIcon(-platform).png should be theme-able", "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": "None", "id": "6" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2017-03-15T21:43:02.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "Adding an iPhone *Settings.bundle* to a platform sub-folder of the theme folder does NOT **merges folders, overwrites files* as stated in the documentation [/Alloy Styles and Themes section|http://docs.appcelerator.com/platform/latest/#!/guide/Alloy_Styles_and_Themes-section-35621526_AlloyStylesandThemes-Themes].\r\n\r\nThe *Settings.Bundle* will ONLY work if it does NOT appear within the theme and resides directly within the project platform folder instead.\r\n\r\nThis process should work, according to both the documentation and the rules I helped define.\r\n\r\nPath of file when inside a theme;\r\n\r\n{noformat}\r\n{project}/app/themes/{theme}/platform/iphone/Settings.bundle/Root.plist\r\n{noformat}\r\n\r\nExample code within file\r\n\r\n{code:xml|title=Root.plist|borderStyle=solid}\r\n\r\n\r\n\r\n\r\n StringsTable\r\n Root\r\n PreferenceSpecifiers\r\n \r\n \r\n Type\r\n PSGroupSpecifier\r\n Title\r\n \r\n \r\n \r\n Type\r\n PSTitleValueSpecifier\r\n Key\r\n Version\r\n Title\r\n Version\r\n DefaultValue\r\n 1.0\r\n \r\n \r\n\r\n\r\n{code}\r\n\r\nHowever when the app is run to a simulator or a device - the contents of the simple example shown above are not used within the app.\r\n\r\nIf the theme folder is not used (for reasons of testing) and instead located at the non-themed path of\r\n\r\n{noformat}\r\n{project}/platform/iphone/Settings.bundle/Root.plist\r\n{noformat}\r\n\r\nWith the very same example code used previously it does perform correctly on both the simulator and the physical device.\r\n\r\nIt appears obvious that NO 'merging and overwriting of files' are occurring on the themed _platform/iphone/Settings.bundle_ folder and potentially this may be true for ALL platform iphone child folders.\r\n\r\nThe themed platform itself has been proven to work as the Android elements held within that folder are used correctly no matter which theme is used.", "attachment": [], "flagged": false, "summary": "Alloy Theme Fails to merge/overwrite the platform/iphone folder - specifically 'Settings.bundle' sub-folder", "creator": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "environment": "*Operating System*\r\n\r\n- Name = Mac OS X\r\n- Version = 10.11.1\r\n- Architecture = 64bit\r\n- CPUs = 4\r\n- Memory = 17179869184\r\n\r\n*Node.js*\r\n\r\n- Node.js Version = 0.12.8\r\n- npm Version = 2.14.9\r\n\r\n*Titanium*\r\n\r\n- CLI Version = 5.0.5\r\n- SDK Version = 5.0.2\r\n- Alloy Version = 1.7.21", "closedSprints": [ { "id": 860, "state": "closed", "name": "2017 Sprint 06 Tooling", "startDate": "2017-03-12T19:12:08.578Z", "endDate": "2017-03-26T19:12:00.000Z", "completeDate": "2017-03-26T22:02:35.349Z", "originBoardId": 199 } ], "comment": { "comments": [ { "id": "371652", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "This seems to be a regression in the Titanium SDK.\r\n\r\n* Alloy pushes 2 CLI args to Titanium for custom i18n and platform dirs: https://github.com/appcelerator/alloy/blob/master/hooks/alloy.js#L178-L179\r\n* Titanium was modified to let these override the default paths: https://github.com/appcelerator/titanium_mobile/pull/6602/files\r\n* But this was removed when [~cbarber] refactored the build process for TIMOB-18840: https://github.com/appcelerator/titanium_mobile/commit/57f6c23afc28379dfd7821c269bb9ec0f16e9cc8#diff-f430483233aa01af5b10df8390f9635dL3745", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-30T13:16:00.000+0000", "updated": "2015-11-30T13:16:00.000+0000" }, { "id": "371659", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "This sounds like an Alloy bug/limitation. I'm not sure exactly how the themes work, so it's hard for me to say. I'll move this ticket to Alloy for further triage.\r\n\r\n[~fokkezb] I'm not sure why {{\\-\\-platform\\-dir}} was created, but now that you've brought it to my attention, I shall remove it from Android since it's not documented and it is not implemented in any other platform's build command.\r\n\r\nFYI, in Titanium SDK 6, there will be a behavior change with {{platform/iphone}}. In Titanium SDK 5.x and older, {{platform/iphone}} gets copied into the actual compiled application output directory. This is not consistent with other platforms and interferes with differential builds. All files in {{platform/*}} should get copied into {{build/}}. So, in Titanium SDK 6, we fix this. Since {{Settings.bundle}} is an edge case, the iOS build will explicitly look for it and copy it to the correct location.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-11-30T18:33:14.000+0000", "updated": "2015-11-30T18:33:14.000+0000" }, { "id": "371662", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "Why is this an 'edge case'? It is a folder with file in it residing inside the platform iphone folder. This can and should follow the same merge and overwrite rules. The logic is no different to android density folders with images inside them.\r\n\r\nSo should I assume;\r\n\r\n# This will not get fixed\r\n## Because somehow it is confusing?\r\n## Because a new version of the SDK 6.0 will change where all previous versions have located files for iOS extras?\r\n# This is no longer related to 5.0.2 as I stated as it is an Alloy issue? If so why is SDK 6.0 the point it will get fixed if Alloy related?\r\n\r\nSorry [~cbarber] but your comment has confused me more.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2015-11-30T18:49:25.000+0000", "updated": "2015-11-30T18:49:25.000+0000" }, { "id": "371663", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~cbarber] it's a TIMOB bug in the sense that it no longer works since 5.x because the SDK no longer applies the {{--platform-dir}} argument added by TIMOB-17446 (a discussion you were mentioned in) to enable ALOY-858. So even if it's not documented it is a regression of a feature added in 4.x and we can't just take it out.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-30T18:50:01.000+0000", "updated": "2015-11-30T18:50:01.000+0000" }, { "id": "371669", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~core13] We're getting off topic of this ticket, but it's an edge case because all files in {{platform/}} should be copied into the {{build/}} directory, not the compiled app output directory. iOS is the only platform that does this. However, this change would mean Settings.bundle would be copied into the build dir and so it's an edge case where we need it copied into the compiled app output dir.\r\n\r\nThere is no \"merge\" logic. We only overwrite and that logic hasn't changed, only the destination. In Titanium SDK 5.x and older, {{Resouces}}, {{Resources/iphone}}, {{Resources/ios}}, {{platform/iphone}}, and {{platform/ios}} copy files to the same directory {{build/iphone/build/Products//.app/}}. This makes no sense and it's not consistent. So, in Titanium SDK 6 I will fix this. Settings.bundle should probably go in the build dir anyways and we'll add it to the Xcode project and let Xcode copy it into the compiled app output dir.\r\n\r\nSo, with regards to the Titanium SDK 6 change and *this* ticket, you have nothing to be worried about. Just know that files in {{platform/iphone}} will be copied to a different place in Titanium SDK 6.\r\n\r\nOk, back on topic.\r\n\r\nAlloy theme files not being copied to the correct destination is an Alloy bug. The {{\\-\\-platform\\-dir}} option is a hack. Alloy must not be lazy and must do things correctly. We'll triage it and eventually fix it.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-11-30T19:45:29.000+0000", "updated": "2015-11-30T19:45:29.000+0000" }, { "id": "371773", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~cbarber] the chicken egg with Alloy theming i18n and platform is that if Titanium always reads from /i18n and /platform then Alloy must somehow first merge/overwrite the defaults in there with that from the theme and after Ti is done compiling revert that. Which is tricky (e.g. if the build fails). So that's why it works as it works (worked) now. I do agree it's hacky ;)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-01T10:13:37.000+0000", "updated": "2015-12-01T14:08:02.000+0000" }, { "id": "371779", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~fokkezb] Sorry, why does Alloy need to revert the copying of files to the i18n and platform directories? Why aren't the i18n and platform directories treated just the same as Resources where they are nuked every build?", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-12-01T14:00:13.000+0000", "updated": "2015-12-01T14:00:13.000+0000" }, { "id": "371780", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Actually... that might be a very clean solution.\r\n\r\n*classic*\r\n\r\n{code}\r\n/i18n\r\n/platform\r\n/Resources\r\n{code}\r\n\r\n*Alloy*\r\n\r\n{code}\r\n/app/i18n\r\n/app/platform/\r\n/app/assets/\r\n\r\n/app/themes/mine/i18n\r\n/app/themes/mine/platform\r\n/app/themes/mine/assets\r\n{code}\r\n\r\nIt would be a tricky breaking change since but one we can check for by making sure there is a {{/app/i18n}} or {{/app/platform}} before we nuke the {{/i18n}} or {{/platform}}\r\n\r\nWhat do you think [~fmiao]?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-01T14:10:46.000+0000", "updated": "2015-12-01T14:10:46.000+0000" }, { "id": "371782", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "To confirm - this only occurs as it is Alloy (which is the subject - so good).\r\n\r\nThe root platform folder */project/platform/* is to be left empty as this now acts in the same manor as build & resources as noted above.\r\n\r\nDuring the Alloy build process;\r\n\r\n# *whatever* is inside */project/platform/* is deleted\r\n# *whatever* is inside */project/app/platform/* is copied into */project/platform/*\r\n# *whatever* is inside */project/app/themes/theme/platform/* is copied into */project/platform/*\r\n# no merges; simply copying and overwriting if previously existed\r\n\r\nThe */project/platform* clean process could be part of each Alloy build (shown above), OR part of the ti clean or a new alloy clean.\r\n\r\nThere would need to be caution that the clean process only occurs for alloy projects of course. Plus sufficient warning for existing projects.\r\n\r\nSame rules apply for *i18n*.\r\n\r\nSimple enough to work. This is essentially what I need to create in a jmk file due to the time factor.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2015-12-01T15:26:53.000+0000", "updated": "2015-12-01T15:26:53.000+0000" }, { "id": "371783", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "yep, indeed... but for i18n it would merge.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-01T15:37:50.000+0000", "updated": "2015-12-01T15:37:50.000+0000" }, { "id": "371792", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "When we were working on ALOY-858, we iterated through all the above suggestions. In fact, Malcolm's elegant solution was in the first PR and it was rejected, the reason given was that _source project files should never be overwritten/modified, specifically the root project i18n/platform files_.\r\n\r\nThe 'hacky' solution was implemented under 2 limitations:\r\n1. alloy compile should not modify source project files\r\n2. titanium build looks for i18n and platform directories under the project root only\r\nA thorough account of the discussion are in the comments of ALOY-858. \r\n\r\nIMHO, this can be easily solved if we could all agree on that Alloy compile is allowed to manipulate the project root platform/i8n directories like what it has been doing to the Resource folder.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-12-01T19:04:45.000+0000", "updated": "2015-12-01T19:04:45.000+0000" }, { "id": "371796", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~core13] Yes, that's what I'm proposing should be the official behavior. I'm not sure how close we are today to that behavior.\r\n\r\n[~fokkezb] We would only need to merge if an app has two xml files with the same name in separate folders (i.e. {{app/i18n}} and {{app/themes/mine/i18n}}). The Titanium build system will merge all *.xml files into a single i18n file. So Alloy really just needs to check if the destination i18n xml file exists and if so, append a number or something to the filename. For example, your Alloy app has {{app/i18n/en-US/strings.xml}} and {{app/themes/mine/i18n/en-US/strings.xml}}, then during compile Alloy would copy {{app/i18n/en-US/strings.xml}} to {{i18n/en-US/strings.xml}} and copy {{app/themes/mine/i18n/en-US/strings.xml}} to {{i18n/en-US/strings2.xml}}. Much easier and faster than doing a merge.\r\n\r\nI agree with [~fmiao] that Alloy apps should be able to modify the root i18n and platform directories just like the Resources directory.\r\n\r\n", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-12-01T20:12:51.000+0000", "updated": "2015-12-01T20:12:51.000+0000" }, { "id": "371798", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "Alloy apps must be able to modify root elements, as it already does with Resources. Given Alloy is the framework used to create the files used to build an app this should go as far as all elements within the app and not just generating the JS code and moving some assets.\r\n\r\nSo if the App is Alloy based then the Platform and i18n root folders follow the exact same rules as the Resources one already does. This simple rule 'correction' allows a far greater degree of control for more than Alloy apps with themes and allows future beneficial features to not be stifled based \"we cannot modify root elements\" as Alloy already does.\r\n\r\nSo I vote \"let us stop pretending Alloy does not already modify root elements\" as it simply persists in harming the evolution of the dev platform going forwards.\r\n\r\nBTW anyone not building an Alloy app when starting a new project is harming themselves, their client, their future productivity not to mention basic human decency rules. Just saying.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2015-12-01T20:29:37.000+0000", "updated": "2015-12-01T20:29:37.000+0000" }, { "id": "377097", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "Any guesses on a time to release on this yet? This month, quarter, half year, year, decade? Trying not to sound flippant - simply trying to see how much hope I should place in this moving forward. ", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2016-02-17T11:58:01.000+0000", "updated": "2016-02-17T11:58:01.000+0000" }, { "id": "389264", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-28T15:11:53.000+0000", "updated": "2016-06-28T15:11:53.000+0000" }, { "id": "412654", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Looks like this has been solved by ALOY-1365. Please reopen if seen again.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2017-03-15T21:41:51.000+0000", "updated": "2017-03-15T21:41:51.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }