编译Groovy项目时更改Gradle的工作目录
问题描述:
在编译一个groovy项目时,gradle会在 $ projectRoot / build /
中创建文件。有没有办法将其配置为一个绝对路径?
When compiling a groovy project, gradle creates files in $projectRoot/build/
. Is there a way to configure this to e.g. an absolute path?
答
建立目录是一个项目属性。您可以通过键入以下命令来查看所有可用的项目属性:
Build directory is a project property. You can view all project properties available to you by typing:
是的,有。您可以在您的构建脚本中放入以下行:
Yes, there is. You can put the following line in your build script:
buildDir = 'your_directory'
或在 gradle.properties
文件中( your_directory
在这种情况下)。
建立目录是一个项目属性。您可以通过键入以下命令来查看所有可用的项目属性:
Or in gradle.properties
file (no quotes around your_directory
in that case).
Build directory is a project property. You can view all project properties available to you by typing:
gradle properties