Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling Gradle daemon in a specific project

I'd like to build certain projects without the use of of Gradle daemon. I've read that this can be done either by command-line argument --no-daemon or by changing Gradle properties under .gradle/. I need to disable it for just some of the projects I build under the root project though.

Is it possible via settings.gradle/build.gradle settings or am I better off making custom build script?

like image 911
Dropout Avatar asked Oct 22 '18 11:10

Dropout


People also ask

How do I stop Gradlew?

You can call . \gradlew --stop in a Terminal and it will kill all gradle processes in Android Studio for Windows OS. You Can find terminal at left bottom of your android studio for windows. Save this answer.

How do I stop Gradle Daemon in Intellij?

Note that it requires you to have gradlew executable in the project directory (it's there by default when using Android Studio). After the installation you can find "Gradle Stop" button on Main Toolbar and inside Run Menu. Please leave all your bug-reports and feature-requests on Github page.

What does the Gradle Daemon do?

The Gradle Daemon keeps the Gradle Framework initialized and running, and caches project data in memory to improve performance. To enable the Daemon for a single build, you can simply pass the --daemon argument to your gradle command or Gradle Wrapper script.

Should I use Gradle Daemon in CI?

It avoids expensive bootstrapping process and leverages caching. So, there is no reason not to utilize Gradle Daemon. In the local environment, it is true. However, it could be wrong if you use CI agents such as Jenkins and TeamCity.


1 Answers

You can simply add org.gradle.daemon=false to a gradle.properties file in the project root folder.

The daemon documentation mainly talks about disabling the daemon altogether on a machine but the gradle properties documentation indicates that the location where a property / value pair is declared is irrelevant, they are sourced from different location, with overwrite rules.

like image 89
Louis Jacomet Avatar answered Jan 01 '23 08:01

Louis Jacomet