如何在 运行 Gradle JavaExec 任务捕获用户输入时抑制 'Building x%' 消息?
How to suppress the 'Building x%' message when running the Gradle JavaExec task to capture user input?
当 运行 一个 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
正如 Haki 先生向我指出的那样,--console plain
命令行选项可以解决问题。
./gradlew :rivescript-samples-rsbot:runApp --console plain
当 运行 一个 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
正如 Haki 先生向我指出的那样,--console plain
命令行选项可以解决问题。
./gradlew :rivescript-samples-rsbot:runApp --console plain