Is there a way to default command-line parameters?


Feels like this should be a FAQ, but I’ve not yet found the answer so I’m guessing I’m using the wrong words to answer it. My question is whether there is a way to force particular command-line options to gradle? For example, I’d prefer to always have the --no-color option; is there a way to do that without an alias/script?

Related but not really, it appears that gradle likes to slurp everything off the input stream, such that if I type in my next command, it is swallowed. Is it possible to stop that behaviour?



Ah, so for number one I now see it is the GRADLE_OPT environment label. Still not clear on the latter one though.

What do you mean by “next command”?

For most applications which do not consume the input stream, you can execute them and while they are running, type in your next command; logically this becomes a “command1 ; command2” (on UNIX-based systems). Ant actually does this nicely, but gradle appears to consume the input stream for some reason, so if I do type in “command2”, my shell never sees it. Does that make sense?

Works fine on my Mac. I don’t see any difference between Gradle’s and Ant’s behavior. Which OS are you on?

I’m on Ubuntu 12.10; I just retried it with “./gradlew clean” and while that was working, I pecked in “./gradlew build” and when the clean finished, it did nothing. Could it be one of our tasks that causes that? Seems weird.

You could try with a different Gradle build, say one that just has a “sleep” task?