Concurrent building is not enabled by default in Gradle . However, to explicitly disable concurrency, you can add
org.gradle.parallel=false
in your gradle.properties project or specify the --no -rallel option for the gradle / gradlew command that starts the build.
An important note here is that for certain versions of Gradle, such as 4.6 and 4.7 and others, disabling parallel execution does not work. The workaround is to specify a very limited number of worker threads . By default, the maximum number of worker threads is equal to the number of your system processors.
So in the gradle.properties project add value
org.gradle.workers.max=1
to limit the number of simultaneous worker threads to 1 or specify the --max-worker = 1 parameter for the gradle / gradlew command that initiates the build.
In versions prior to Gradle 4.10, incremental build is not enabled by default . For versions after 4.10, you can add the following to your build.gradle (most likely, to the top-level file in a multi-module project) to disable Java incremental compilation:
tasks.withType(JavaCompile) { options.incremental = false }
source share