Skip to content

Commit

Permalink
πŸ› Change annotation on output properties
Browse files Browse the repository at this point in the history
@input properties must be serializable.
  • Loading branch information
phatblat committed Jan 18, 2020
1 parent d0dcd86 commit c72d0ec
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 c72d0ec

Please sign in to comment.