https://kotlinlang.org logo
#ktor
Title
# ktor
g

Gunslingor

07/03/2020, 10:35 PM
Anyone know what I'm doing wrong here, trying to capture the output from the command, always gettiung the stream id instead of the stream no matter what I try. Ultimately trying to spin up local docker image after build but presently just trying to run basic commands so I know that part is working:
Copy code
register<Exec>("runFatJarLocallyInDocker") {
    group = "application"
    dependsOn(mutableSetOf<Any>("buildFatJar"))
    commandLine = mutableListOf("cmd", "dir")
    val std = standardOutput
    doLast {
        println()
        println("Output: ${std.toString()}")
        println("Error: ${errorOutput.toString()}")
    }

    /*
    commandLine(
        "docker dir",
        "docker build -t ${project.name}-fat.jar",
        "docker run -m512M --cpus 2 -it -p 8080:8080 --rm ${project.name}-fat.jar"
    )*/
}
Output: org.gradle.process.internal.streams.SafeStreams$2@33e60aef
Error: org.gradle.process.internal.streams.SafeStreams$1@6fed0bb8
2 Views