Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Gradle's working directory when compiling a Groovy project

Tags:

gradle

groovy

When compiling a groovy project, gradle creates files in $projectRoot/build/. Is there a way to configure this to e.g. an absolute path?

like image 258
Armand Avatar asked Dec 17 '12 13:12

Armand


People also ask

What is .Gradle directory?

The Gradle user home directory ( $USER_HOME/.gradle by default) is used to store global configuration properties and initialization scripts as well as caches and log files.

How is .Gradle folder created?

A gradle process is started as soon as you run a command starting with gradle <with args> in a directory where a build. gradle exists. (note that if you use the wrapper : the command is gradlew <with args> ) . When using an IDE (like Android Studio) : the IDE can start the gradle process for you.


1 Answers

Yes, there is. You can put the following line in your build script:

buildDir = '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
like image 159
Sergey Weiss Avatar answered Sep 28 '22 17:09

Sergey Weiss