From f7903788e199535cd5589e3149ea3e7ec0684c33 Mon Sep 17 00:00:00 2001 From: Sten Roger Sandvik Date: Wed, 14 Jun 2017 23:56:39 +0200 Subject: [PATCH] Fixed problem with bufferedOutput. --- src/main/groovy/com/moowork/gradle/grunt/GruntTask.groovy | 6 +++--- src/main/groovy/com/moowork/gradle/gulp/GulpTask.groovy | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/groovy/com/moowork/gradle/grunt/GruntTask.groovy b/src/main/groovy/com/moowork/gradle/grunt/GruntTask.groovy index e393797..4d39b90 100644 --- a/src/main/groovy/com/moowork/gradle/grunt/GruntTask.groovy +++ b/src/main/groovy/com/moowork/gradle/grunt/GruntTask.groovy @@ -35,7 +35,7 @@ class GruntTask // If output should be buffered (useful when running in parallel) // set standardOutput of ExecRunner to a buffer - def bufferedOutput + ByteArrayOutputStream bufferedOutput if ( this.project.grunt.bufferOutput ) { bufferedOutput = new ByteArrayOutputStream() @@ -55,10 +55,10 @@ class GruntTask finally { // If we were buffering output, print it - if ( this.project.grunt.bufferOutput ) + if ( this.project.grunt.bufferOutput && ( bufferedOutput != null ) ) { println "Output from ${gruntFile}" - println this.project.grunt.bufferedOutput.toString() + println bufferedOutput.toString() } } } diff --git a/src/main/groovy/com/moowork/gradle/gulp/GulpTask.groovy b/src/main/groovy/com/moowork/gradle/gulp/GulpTask.groovy index 1f765e2..e126269 100644 --- a/src/main/groovy/com/moowork/gradle/gulp/GulpTask.groovy +++ b/src/main/groovy/com/moowork/gradle/gulp/GulpTask.groovy @@ -30,7 +30,7 @@ class GulpTask // If output should be buffered (useful when running in parallel) // set standardOutput of ExecRunner to a buffer - def bufferedOutput + ByteArrayOutputStream bufferedOutput if ( this.project.gulp.bufferOutput ) { bufferedOutput = new ByteArrayOutputStream() @@ -50,10 +50,10 @@ class GulpTask finally { // If we were buffering output, print it - if ( this.project.gulp.bufferOutput ) + if ( this.project.gulp.bufferOutput && ( bufferedOutput != null ) ) { println "Output from ${this.project.gulp.workDir}/gulpfile.js" - println this.project.gulp.bufferedOutput.toString() + println bufferedOutput.toString() } } }