It's far from perfect, but I created a small plugin to alias gradle
commands.
https://launchpad.net/gradle-aliases

Once installed you can run 'gradle createAlias'. It'll prompt you for the
alias name, and the commands (entered as you would on the command line).
This creates a groovy file in the project .gradle directory
'aliases.groovy'.

The format of the file is really simple, and the file can manually be edited
with the aliases showing up as tasks.

You should then see the aliases appear when 'gradle tasks' is run.

It's pretty stupid simple though, and doesn't work with other tasks that
require user input.

Still, has been pretty useful to me. Hopefully it'll be useful for others.
:)

Cheers,
Eric

On Thu, Jun 23, 2011 at 5:07 PM, Adam Murdoch
<adam.murd...@gradleware.com>wrote:

>
> On 22/06/2011, at 10:49 PM, evgenyg wrote:
>
> Hi,
>
> What do you think of the following feature suggestion to Gradle: being able
> to easily alias commonly repeated commands combinations. For example, I run
> *"gradle build deploy -PnoGroovy -x test -x about"* very frequently
> (lightweight build & deploy) and *"gradle clean build deploy"* less
> frequently (full build & deploy).
>
>
> This looks like something you could code up in your build script as a
> lifecycle task:
>
> task minimalDeploy {
>     dependOn assemble, deploy
>     gradle.taskGraph.whenReady { graph -> if ( graph.hasTask(it) ) {
> project.noGroovy = true } }
> }
>
> To me, there's no difference between a lifecycle task, which gives a
> human-friendly name to some workflow step, and an alias, which also gives a
> human-friendly name to some workflow step. Instead of adding support for
> aliases, I'd rather improve our support for defining tasks which do more
> than just dependOn other tasks.
>
>
>
> If I could map, say, "lightweight" or "l" to *"build deploy -PnoGroovy -x
> test -x about"* and "full" or "f" to *"clean build deploy"* in
> "build.gradle", then I could simply run "gradle lightweight" or "gradle l"
> or "gradle f".
>
> This is not a regular task dependency but merely a shortcut to command-line
> combinations typed, mapped as a String to some shorter command.
>
>
>
>
> -----
> Best regards,
>
> Evgeny
>
> evgeny-goldin.com
>
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/Aliasing-commonly-repeated-tasks-combination-tp4513918p4513918.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
>
> --
> Adam Murdoch
> Gradle Co-founder
> http://www.gradle.org
> VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
> http://www.gradleware.com
>
>


-- 
Learn from the past. Live in the present. Plan for the future.
Blog: http://eric-berry.blogspot.com
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans

Reply via email to