如何强制gradle打印或记录所有已执行的编译器命令?

Jon*_*rpe 7 gradle

我试图查看在执行所有构建任务期间gradle使用的确切编译器命令(在我的情况下为gcc)。运行with --debug不会输出这些命令,并且build / tmp中的输出文件也没有。我目前正在使用Gradle 2.6

RaG*_*aGe 5

$projectDir/build/tmp

您应该有一个类似于以下内容的文件夹结构:

????compileMainSharedLibraryMainCpp
?       options.txt
?       output.txt
?
????compileMainStaticLibraryMainCpp
?       options.txt
?       output.txt
?
????createMainStaticLibrary
?       options.txt
?       output.txt
?
????linkMainSharedLibrary
        options.txt
        output.txt
Run Code Online (Sandbox Code Playgroud)

options.txt包含传递给编译器/链接器等的选项,并output.txt包含编译器/链接器的输出。

  • 它对我不起作用。这个故事肯定还有更多内容: > gradle clean build; ...大量输出...; find build/tmp -name options.txt -print; ...没有输出... (3认同)