I use Gradle 2.10 on Ubuntu 16.04.1 LTS
I was getting told "This build could be faster, please consider using the Gradle Daemon" so I created a ~/.gradle/gradle.properties
file containing org.gradle.daemon=true
.
Result: Every time I run ./gradlew build
, I am now told:
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
... every single time. And the build does not get faster and faster: it always takes about 10 seconds. If I run the build 3 times in a row, it outputs the message above 3 times, and though I am well below Gradle's 3 hours of inactivity automatic shutdown.
How to fix this and make the daemon survive for a longer time?
In the root of the project create gradle.properties
with
org.gradle.daemon=true
It keeps the instance of gradle up and running in the background even after your build finishes.
It doesn't work for CI environment (travis ci for example) if your environment recreated every build.
There are no configs in default gradle for increase daemon uptime.