{ "id": "117681", "key": "ALOY-765", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15403", "description": "Alloy 1.3.0", "name": "Alloy 1.3.0", "archived": false, "released": true, "releaseDate": "2013-12-20" }, { "id": "15753", "description": "2013 Sprint 22", "name": "2013 Sprint 22", "archived": true, "released": true, "releaseDate": "2013-11-01" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-10-23T20:27:50.000+0000", "created": "2013-07-27T18:53:37.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "alloy", "compiler", "hook", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "33161", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "122321", "key": "TIDOC-1356", "fields": { "summary": "Guides: Update Alloy Docs for Release 1.3.0", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-11T22:14:05.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": "The first compiler hook is currently {{pre:compile}} and runs before compile (duh..), but after libs and assets have been copied.\r\n\r\nI did an {{alloy.jmk}} file that searches for retina {{@2x}} images and uses ImageMagick to generate non-retina images if they don't already exist. Now because the {{pre:compile}} hooks runs *after* the assets have been copied, I have to search both the {{app}} and the {{Resources}} folder.\r\n\r\nI'm sure there are other cases like this, for which a new {{pre:assets|files|copy}} hook would be useful. For the above use case, having this hook would also allow me to know the time of the previous compile (by getting the ctime of the {{Resources/alloy}} folder) and use this to detect updated retina files as well.", "attachment": [], "flagged": false, "summary": "Alloy: Introduce a compiler hook that runs before assets are copied", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Any", "comment": { "comments": [ { "id": "263925", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Oe would it make more sense to just have the pre:compile hook fire earlier in the process, before anything is moved to the Resources folder?", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-30T14:00:47.000+0000", "updated": "2013-07-30T14:00:47.000+0000" }, { "id": "263987", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "If that wouldn't mess up how people use it that would be OK of course. The only reason it would is that you want to change the copied files BEFORE compile, but since these files are not affected by compile that wouldn't make sense. So yeah, if you're OK with that... GO :)", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-07-30T18:38:16.000+0000", "updated": "2013-07-30T18:38:16.000+0000" }, { "id": "276315", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR: https://github.com/appcelerator/alloy/pull/252", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-10-23T08:48:52.000+0000", "updated": "2013-10-23T08:48:52.000+0000" }, { "id": "276441", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h3. functionality\r\n\r\nThe existing *pre:compile* and *post:compile* tasks will execute just as they have in the past, at the same time in the process that they always have. A new task *pre:load* will be executed before any assets or libraries are copied into the alloy project's resources folder.\r\n\r\nh3. testing\r\n\r\nPR: https://github.com/appcelerator/alloy/pull/255\r\ntest app: https://github.com/appcelerator/alloy/tree/master/test/apps/advanced/alloy_jmk\r\n\r\nFunctional test:\r\n\r\n# Run the test app\r\n# Check the alloy console output to ensure that all 3 hooks fire in this order\r\n** pre:load\r\n** pre:compile\r\n** post:compile\r\n# Ensure that the files {{dummy1.txt, dummy2.txt, dummy3.txt}} appear in the list of files in the *pre:compile* step, but not the *pre:load* step. *NOTE:* If you perform the compile more than once, the dummy files will appear in both steps.\r\n# Make sure there are no errors", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-23T20:27:50.000+0000", "updated": "2013-10-23T20:27:50.000+0000" }, { "id": "277051", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified working as expected. \n\nTiSDK 3.2.0.v20131028093244 \nCLI 3.2.0\nAlloy 1.3.0\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-28T22:36:50.000+0000", "updated": "2013-10-28T22:36:50.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }