arquillian / arquillian-spacelift

Arquillian process and package manager. Makes executing an external process or fetching platform depends dependencies an easier job
4 stars 7 forks source link

CommandBuilder with static method #12

Open lordofthejars opened 10 years ago

lordofthejars commented 10 years ago

Hi, I use arquillian-spacelift in many places in my project, probably I am the only one who see the power of it.

But one thing that I miss is that CommandBuilder does not have an static method to create it. It has constructor but with static method we will be able to import statically and create a more semantic expression when using Tasks class.

import static ...CommandBuilder.execute;

....then(CommandTool.class).command(execute("ls"));

Of course the name of the static method can be another one, but I think it follows the idea of a DSL instead of putting a new CommandBuilder in the middle of the expression.

If you agree I can implement without any problem.

TadeasKriz commented 10 years ago

Hi,

did you try to use the methods of the CommandTool itself? The example you show here could be written using those fluent API methods like so:

Tasks.prepare(CommandTool.class).programName("ls");

The CommandTool has many methods like this, allowing you to change working directory, specify parameters, add environment properties, allowed exit codes etc.

Does this solve your problem or is there another reason why do you want to use CommandBuilder yourself?

lordofthejars commented 10 years ago

No it solves the "problem" but it was to align the API and let users use all approaches in similar way. But nothing more than this.

2014-10-02 15:11 GMT+02:00 Tadeas Kriz notifications@github.com:

Hi,

did you try to use the methods of the CommandTool itself? The example you show here could be written using those fluent API methods like so:

Tasks.prepare(CommandTool.class).programName("ls");

The CommandTool has many methods like this, allowing you to change working directory, specify parameters, add environment properties, allowed exit codes etc.

Does this solve your problem or is there another reason why do you want to use CommandBuilder yourself?

— Reply to this email directly or view it on GitHub https://github.com/arquillian/arquillian-spacelift/issues/12#issuecomment-57627066 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

TadeasKriz commented 10 years ago

I see, that's a good point. I'm not sure what was the initial idea behind the CommandBuilder, but I believe that you would use the CommandBuilder when you want to pass the command through your code on multiple places and then feed it into the CommandTool. But I might be totally off track on this one and it would be probably better if @kpiwko could look at your proposal.

Anyway we are really glad that you like and use SpaceLift and we hope you'll keep using it and keep reporting any bugs you might find. Thank you.

lordofthejars commented 10 years ago

In fact today I am opening some improvement issues. I can implement by myself but I prefer that Karel can take a view first.

2014-10-02 15:21 GMT+02:00 Tadeas Kriz notifications@github.com:

I see, that's a good point. I'm not sure what was the initial idea behind the CommandBuilder, but I believe that you would use the CommandBuilder when you want to pass the command through your code on multiple places and then feed it into the CommandTool. But I might be totally off track on this one and it would be probably better if @kpiwko https://github.com/kpiwko could look at your proposal.

Anyway we are really glad that you like and use SpaceLift and we hope you'll keep using it and keep reporting any bugs you might find. Thank you.

— Reply to this email directly or view it on GitHub https://github.com/arquillian/arquillian-spacelift/issues/12#issuecomment-57628216 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+