Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19854

Capture Exec output using Kotlin DSL

$
0
0

Something like the following groovy (please convert to kotlin)

task gitLog {
   ext.outfile = file("$buildDir/commit.json")
   outputs.file outfile
   doLast {
      outfile.withOutputStream { out ->
         project.exec {
            commandLine "bash ${utilDir}/build/git-log2json.sh".split(' ')
            standardOutput = out
            ignoreExitValue = false // don't need this line, it's the default 
         }
      } 
   } 
} 

See ExecSpec


Viewing all articles
Browse latest Browse all 19854

Trending Articles