diff --git a/src/main/kotlin/at.phatbl.shellexec/ShellExec.kt b/src/main/kotlin/at.phatbl.shellexec/ShellExec.kt index 5a8a2de..5046057 100644 --- a/src/main/kotlin/at.phatbl.shellexec/ShellExec.kt +++ b/src/main/kotlin/at.phatbl.shellexec/ShellExec.kt @@ -4,6 +4,7 @@ import at.phatbl.shellexec.logging.GradleLogOutputStream import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.logging.LogLevel +import org.gradle.api.tasks.Console import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.Internal @@ -24,10 +25,10 @@ open class ShellExec: DefaultTask() { @InputDirectory var workingDir: File = project.projectDir - @Input + @Console var standardOutput: OutputStream = GradleLogOutputStream(logger, LogLevel.LIFECYCLE) - @Input + @Console var errorOutput: OutputStream = GradleLogOutputStream(logger, LogLevel.ERROR) @Input diff --git a/src/main/kotlin/at.phatbl.shellexec/logging/GradleLogOutputStream.kt b/src/main/kotlin/at.phatbl.shellexec/logging/GradleLogOutputStream.kt index 53eebad..12addc1 100644 --- a/src/main/kotlin/at.phatbl.shellexec/logging/GradleLogOutputStream.kt +++ b/src/main/kotlin/at.phatbl.shellexec/logging/GradleLogOutputStream.kt @@ -9,7 +9,11 @@ import java.io.File /** * Adapter which passes log output through to Gradle's logger. */ -class GradleLogOutputStream(val logger: Logger, level: LogLevel, val logFiles: Array? = null): LogOutputStream(level.ordinal) { +class GradleLogOutputStream( + val logger: Logger, + level: LogLevel, + val logFiles: Array? = null +): LogOutputStream(level.ordinal) { /** * Logs a line to the log system of the user. *