Skip to content

Commit

Permalink
Merge pull request #68 from phatblat/annotation
Browse files Browse the repository at this point in the history
πŸ› Change annotation on output properties
  • Loading branch information
phatblat authored Jan 20, 2020
2 parents d0dcd86 + c72d0ec commit f6761a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/at.phatbl.shellexec/ShellExec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<File>? = null): LogOutputStream(level.ordinal) {
class GradleLogOutputStream(
val logger: Logger,
level: LogLevel,
val logFiles: Array<File>? = null
): LogOutputStream(level.ordinal) {
/**
* Logs a line to the log system of the user.
*
Expand Down

0 comments on commit f6761a0

Please sign in to comment.