KAFKA-2613; Make maxParallelForks configurable via Gradle config so it can be turned down on shared build infrastructure.

Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Ismael Juma, Sriharsha Chintalapani

Closes #293 from ewencp/kafka-2613-user-configurable-max-forks
This commit is contained in:
Ewen Cheslack-Postava 2015-10-12 18:26:38 -07:00 committed by Gwen Shapira
parent dd514b2bb8
commit d7340503a1
2 changed files with 9 additions and 1 deletions

View File

@ -105,6 +105,12 @@ Please note for this to work you should create/update `~/.gradle/gradle.properti
### Running checkstyle on the java code ###
./gradlew checkstyleMain checkstyleTest
### Limit the number of processes for each task ###
./gradlew -Dorg.gradle.project.maxParallelForks=1 test
This will most commonly be useful for automated builds where the full resources of the host running the build and tests
may not be dedicated to Kafka's build.
### Running in Vagrant ###
See [vagrant/README.md](vagrant/README.md).

View File

@ -45,6 +45,8 @@ ext {
gradleVersion = "2.4"
buildVersionFileName = "kafka-version.properties"
userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT")
@ -124,7 +126,7 @@ subprojects {
}
tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors()
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
}
jar {