Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -116,7 +118,7 @@ subprojects {
}

tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors()
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
}

jar {
Expand Down