运行Gradle JavaExec任务以捕获用户输入时是否可以禁止'Building x%'
消息?
我有一个自定义的JavaExec任务,如:
task runApp(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "RSBot"
standardInput = System.in
}
它使用standardInput
来捕获用户输入。
捕获用户输入,直到退出该过程。
JavaExec任务在底部继续显示> Building 87% > :rivescript-samples-rsbot:runApp
消息的问题非常烦人,因为用户需要在那里输入输入。
请看下面的例子。
$ ./gradlew :rivescript-samples-rsbot:runApp
:rivescript-core:compileJava UP-TO-DATE
:rivescript-core:processResources UP-TO-DATE
:rivescript-core:classes UP-TO-DATE
:rivescript-core:jar UP-TO-DATE
:rivescript-samples-rsbot:compileJava UP-TO-DATE
:rivescript-samples-rsbot:processResources UP-TO-DATE
:rivescript-samples-rsbot:classes UP-TO-DATE
:rivescript-samples-rsbot:runApp
. .
.:...:: RiveScript Java // RSBot
.:: ::. Version: 0.6.0
..:;;. ' .;;:..
. ''' . Type '/quit' to quit.
:;,:,;: Type '/help' for more options.
: :
:: Creating RS Object
:: Loading replies
You>
> BuiBot> How do you do. Please state your problem.
You>
> BuiBot> Please go on. pt-samples-rsbot:runApphelp
You>
> BuiBot> You're now playing the game. Type "help" for help.
You are in the lobby of a NASA launch base on Earth. There is an elevator to the north.
You>
> Building 87% > :rivescript-samples-rsbot:runApp
答案 0 :(得分:2)
正如Haki先生向我指出的那样,--console plain
命令行选项可以解决问题。
./gradlew :rivescript-samples-rsbot:runApp --console plain