gpt4 book ai didi

kotlin - 如何让 Kotlin 编译器将警告视为错误?

转载 作者:IT老高 更新时间:2023-10-28 13:30:10 29 4
gpt4 key购买 nike

我有一个 Kotlin 项目,我希望将 Kotlin 警告视为错误。我该怎么做?

最佳答案

从 Kotlin 1.2 开始,支持命令行参数 -Werror。在 Gradle 中,它被命名为 allWarningsAsErrors:

compileKotlin {
kotlinOptions.allWarningsAsErrors = true
}

关于kotlin - 如何让 Kotlin 编译器将警告视为错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34562200/

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