编译 Groovy 项目时更改 Gradle 的工作目录 [英] Change Gradle's working directory when compiling a Groovy project
本文介绍了编译 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?
推荐答案
是的,有.您可以在构建脚本中添加以下行:
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
这篇关于编译 Groovy 项目时更改 Gradle 的工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文