简体   繁体   English

您如何记录 Gradle 使用的所有编译器选项?

[英]How do you log all the compiler options being used by Gradle?

I'm using Gradle 7.4.2.我正在使用 Gradle 7.4.2。 I'm trying to see what it uses for generatedSourceOutputDirectory (among other CompileOptions .我正在尝试查看它用于generatedSourceOutputDirectory的内容(以及其他CompileOptions

I've tried:我试过了:

tasks.compileJava {
    println(options.generatedSourceOutputDirectory.toString())
}

but this prints an unhelpful:但这打印出一个无用的:

task ':lib:compileJava' property 'options.generatedSourceOutputDirectory'

Sleuthing around the code itself on Github, I see that's its defaults are (seemingly) mangaged via XML code here .在 Github 上侦查代码本身,我发现它的默认值(似乎)是通过 XML 代码在这里进行管理的。

How can I see what the current compile options are?我怎样才能看到当前的编译选项是什么?

The option generatedSourceOutputDirectory is of type DirectoryProperty ;选项generatedSourceOutputDirectoryDirectoryProperty类型; therefore, to get the value that it holds, you need to call get() .因此,要获取它所持有的值,您需要调用get()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM