mirror of https://github.com/apache/kafka.git
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:
parent
dd514b2bb8
commit
d7340503a1
|
@ -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).
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue