Skip to content

Commit

Permalink
MINOR: Add property to configure showing of standard streams in Gradle
Browse files Browse the repository at this point in the history
This is handy when debugging certain kinds of Jenkins failures.

Author: Ismael Juma <[email protected]>

Reviewers: Guozhang Wang <[email protected]>, Ewen Cheslack-Postava <[email protected]>

Closes apache#739 from ijuma/gradle-show-standard-streams
  • Loading branch information
ijuma authored and ewencp committed Jan 8, 2016
1 parent 58def1c commit 8d67485
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ Please note for this to work you should create/update `~/.gradle/gradle.properti
signing.password=
signing.secretKeyRingFile=

### Publishing the jars without signing to a local repository ###
./gradlew -Dorg.gradle.project.skipSigning=true -Dorg.gradle.project.mavenUrl=file://path/to/repo uploadArchivesAll
### Installing the jars to the local Maven repository ###
./gradlew installAll

### Building the test jar ###
./gradlew testJar
Expand All @@ -115,12 +115,18 @@ 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.

### Common build options ###

The following options should be set with a `-D` switch, for example `./gradlew -Dorg.gradle.project.maxParallelForms=1 test`.

* `org.gradle.project.mavenUrl`: sets the URL of the maven deployment repository (`file://path/to/repo` can be used to point to a local repository).
* `org.gradle.project.maxParallelForks`: limits the maximum number of processes for each task.
* `org.gradle.project.showStandardStreams`: shows standard out and standard error of the test JVM(s) on the console.
* `org.gradle.project.skipSigning`: skips signing of artifacts.

### Running in Vagrant ###

See [vagrant/README.md](vagrant/README.md).
Expand Down
20 changes: 12 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ allprojects {
}

ext {
gradleVersion = "2.10"
buildVersionFileName = "kafka-version.properties"
gradleVersion = "2.10"
buildVersionFileName = "kafka-version.properties"

userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null
userMaxForks = project.hasProperty('maxParallelForks') ? maxParallelForks.toInteger() : null

skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT") && project.gradle.startParameter.taskNames.any { it.contains("upload") }
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT") && project.gradle.startParameter.taskNames.any { it.contains("upload") }

mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''

userShowStandardStreams = project.hasProperty("showStandardStreams") ? showStandardStreams : null

mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
}

apply from: file('wrapper.gradle')
Expand Down Expand Up @@ -134,6 +137,7 @@ subprojects {
maxParallelForks = userMaxForks ?: Runtime.runtime.availableProcessors()
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = userShowStandardStreams ?: false
exceptionFormat = 'full'
}
}
Expand Down

0 comments on commit 8d67485

Please sign in to comment.