gpt4 book ai didi

java - Sublime 构建扰乱 Gradle 构建输出

转载 作者:行者123 更新时间:2023-12-02 03:35:49 24 4
gpt4 key购买 nike

我正在使用 Sublime Text 构建系统运行 gradle Java 构建。我使用的是 Linux Mint 19.1。

当我从 sublime text 运行构建命令(gradlew build)时,输出被扰乱。从终端运行相同的构建时,输出符合预期。在 Sublime 中,输出的第一个字符“> Task”消失了,并且单词“FAILED”的第一个实例加上下面的换行符被向下移动了几行。

在终端

> Task :compileJava FAILED
/home/me/mycode/src/main/java/CLIClient.java:4: error: class, interface, or enum expected
sfpublic class CLIClient {
^
1 error


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 actionable task: 1 executed

Sublime

:compileJava/home/me/mycode/src/main/java/CLIClient.java:4: error: class, interface, or enum expected
sfpublic class CLIClient {
^
1 error
FAILED

FAILURE: Build failed with an exception.

* What went wrong:
1 actionable task: 1 executed
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

我的 Sublime 构建系统定义如下...

{
"cmd": ["./gradlew" , "build"],
"working_dir": "${project_path}",
"file_regex": "^(/...*?):([0-9]*):?([0-9]*)"
}

最佳答案

默认情况下,gradle 会执行一些命令行魔法,在屏幕上显示当前任务的进度。它还显示颜色。我猜这与 sublime text 不兼容。

您可以通过在 gradle 命令行上传递 --console=plain 来关闭此功能

我猜这意味着

{
"cmd": ["./gradlew" , "build", "--console=plain"],
"working_dir": "${project_path}",
"file_regex": "^(/...*?):([0-9]*):?([0-9]*)"
}

关于java - Sublime 构建扰乱 Gradle 构建输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56862231/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com