[ALOY-179] Adding commands 'dry-run' option
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Hold |
Resolution Date | 2012-09-11T10:09:06.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK, Titanium Studio, XML |
Labels | n/a |
Reporter | Shalom Gibly |
Assignee | Tony Lukasavage |
Created | 2012-08-14T09:47:52.000+0000 |
Updated | 2013-05-01T14:56:15.000+0000 |
Description
At the moment, the Studio side has to check for possible name conflicts when calling the 'generate' commands.
Those 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.).
At 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.
This 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.
This 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:
Call a dry-run command. Something like:
Call a dry-run command. Something like: alloy generate widget MyWidget --dry-run
alloy generate widget MyWidget --dry-run
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?
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. Also, 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. I 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 ;) Also, 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.
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.
@Russ...how does this relate to the new CLI? Won't we still be calling
alloy generate widget
?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". But 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.
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.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.
Waiting til new CLI is implemented