Repository: kafka Updated Branches: refs/heads/trunk dd514b2bb -> d7340503a
KAFKA-2613; Make maxParallelForks configurable via Gradle config so it can be turned down on shared build infrastructure. Author: Ewen Cheslack-Postava <[email protected]> Reviewers: Ismael Juma, Sriharsha Chintalapani Closes #293 from ewencp/kafka-2613-user-configurable-max-forks Project: http://git-wip-us.apache.org/repos/asf/kafka/repo Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/d7340503 Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/d7340503 Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/d7340503 Branch: refs/heads/trunk Commit: d7340503a14e3f31d96e3582e36c0255cd008e03 Parents: dd514b2 Author: Ewen Cheslack-Postava <[email protected]> Authored: Mon Oct 12 18:26:38 2015 -0700 Committer: Gwen Shapira <[email protected]> Committed: Mon Oct 12 18:26:38 2015 -0700 ---------------------------------------------------------------------- README.md | 6 ++++++ build.gradle | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kafka/blob/d7340503/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index a4a3f78..d714df7 100644 --- a/README.md +++ b/README.md @@ -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). http://git-wip-us.apache.org/repos/asf/kafka/blob/d7340503/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 51d4a78..2b0f66b 100644 --- a/build.gradle +++ b/build.gradle @@ -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 {
