{ "id": "99184", "key": "ALOY-179", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "6", "description": "", "name": "Hold" }, "resolutiondate": "2012-09-11T10:09:06.000+0000", "created": "2012-08-14T09:47:52.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "19909", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "99185", "key": "TISTUD-2104", "fields": { "summary": "Integrate with the Alloy dry-run command", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-05-01T14:56:15.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": "12332", "name": "Titanium SDK", "description": "Any integration or issues with the TiSDK" }, { "id": "12331", "name": "Titanium Studio" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "At the moment, the Studio side has to check for possible name conflicts when calling the 'generate' commands.\r\nThose file-names are hard coded in the code, and we look for any conflicting files in the project before we allow generating (widgets, models etc.).\r\nAt the end of the process, the Studio also opens up for editing the generated files. Again, by looking at the hard-coded locations, and by appending the name that the user input via the wizard dialog.\r\n\r\nThis mechanism is pretty fragile, and in case Alloy adds or removes a generated file, a Studio update will have to be pushed to follow that change.\r\n\r\nThis leads to a need for some sort of a 'dry-run' argument that can be passed to the 'generate' command, and this is the outline of what I have in mind:\r\n# Call a dry-run command. Something like: {code}alloy generate widget MyWidget --dry-run{code}\r\n# In case no existing conflicting files exist in the target location (project), Alloy will then write out to the output stream the file paths (relative to the working directory) that will be generated.\r\n# In case there is an existing file that cause for a name conflict, the Alloy command will return some sort of an error code and the file(s) that conflicts it.\r\n# When there are errors, we will not allow the 'OK' button in the wizard, and we will show the error Alloy returned. When everything is OK, we will use the list of returned paths, and open those files at the end of the operation.\r\n\r\nThanks! ", "attachment": [], "flagged": false, "summary": "Adding commands 'dry-run' option", "creator": { "name": "sgibly", "key": "sgibly", "displayName": "Shalom Gibly", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sgibly", "key": "sgibly", "displayName": "Shalom Gibly", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "216692", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It seems Alloy could just do the right thing if widget exists and a user tries to generate a new one alloy should simply tell the user the files already exists. I don't understand why Studio cares?", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T20:20:12.000+0000", "updated": "2012-08-28T20:20:12.000+0000" }, { "id": "216709", "author": { "name": "sgibly", "key": "sgibly", "displayName": "Shalom Gibly", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We would like to alert the user in the wizard that these files are already there. In these cases, we will simply not allow the 'OK' on that wizard.\r\nAlso, and even more important, we want to open up those generated files at the end of the process. So in case you add another type of file, the studio will open it without having to change its java code. \r\n\r\nI understand that the CLI notify the user that the files are already there (or one of them). However, it's easier for us to get the response in a structured form (like JSON), instead of parsing it and hoping you will not change the text ;)\r\nAlso, I still think it's nicer to inform the user that a file (or a few) will not be generated while the wizard is open. As a user, I find it a lot more informative and friendly.", "updateAuthor": { "name": "sgibly", "key": "sgibly", "displayName": "Shalom Gibly", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-28T22:52:09.000+0000", "updated": "2012-08-28T22:52:09.000+0000" }, { "id": "216783", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Okay sounds good. How will the new platform CLI handle this? Since Alloy will be a part of the new CLI then I think we need to do what the new CLI does. ", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T08:57:58.000+0000", "updated": "2012-08-29T08:57:58.000+0000" }, { "id": "216833", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Russ...how does this relate to the new CLI? Won't we still be calling {{alloy generate widget}}?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T11:17:03.000+0000", "updated": "2012-08-29T11:17:03.000+0000" }, { "id": "216851", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "When the CLI is in place it will be something like \"titanium alloy generate widget\". At least that is how Chris is thinking about it currently. I'm pushing Alloy to be the default so it would be like \"titanium generate widget\".\r\n\r\nBut more I was wondering how you are handling the current tasks like new project, and how that will be handled with the new CLI. If there was a standard or protocol the CLI commands report back then I would like to do that. ", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-29T11:57:07.000+0000", "updated": "2012-08-29T11:57:07.000+0000" }, { "id": "216987", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Russ. I have no idea how the new CLI will handle it. Honestly, until there is a new mechanism, I'm just going to call {{alloy X}} directly.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-30T08:44:35.000+0000", "updated": "2012-08-30T08:44:35.000+0000" }, { "id": "217256", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Alloy and I think Studio and various teams will be talking next week to Chris about the new CLI. I'll sure to bring up the idea of Studio dry runs so we all implement them in a similar way.\r\n", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-31T15:49:50.000+0000", "updated": "2012-08-31T15:49:50.000+0000" }, { "id": "218385", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Waiting til new CLI is implemented", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-11T10:09:06.000+0000", "updated": "2012-09-11T10:09:06.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }