From 214fb4909124da41aca8aea21862eb9727c826bb Mon Sep 17 00:00:00 2001 From: mmuller Date: Mon, 17 Dec 2018 10:59:27 -0800 Subject: [PATCH] Add "showAllOutput" project property Added a property to show all test output, useful for debugging. Usage: ./gradlew -PshowAllOutput=true build Tested: Verified that the property does the right thing for true and false values and verified that the build doesn't show test output if it's omitted. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225854375 --- gradle/build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gradle/build.gradle b/gradle/build.gradle index 1a39540b9..742374d65 100644 --- a/gradle/build.gradle +++ b/gradle/build.gradle @@ -20,6 +20,13 @@ plugins { id 'com.bmuschko.docker-java-application' version '4.0.4' apply false } +// Provide defaults for all of the project properties. + +// showAllOutput: boolean. If true, dump all test output during the build. +if (!project.hasProperty('showAllOutput')) { + ext.showAllOutput = 'false' +} + // Only do linting if the build is successful. gradleLint.autoLintAfterFailure = false @@ -245,6 +252,10 @@ subprojects { } } + test { + testLogging.showStandardStreams = Boolean.parseBoolean(showAllOutput) + } + if (project.name == 'core') return ext.relativePath = "google/registry/${project.name}"