groovy

Provide better mechanisms to allow output and error streams from run process to be captured

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1-rc-3
  • Fix Version/s: 1.5.4, 1.5.5, 1.5.6
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Split off short-term enhancements for getText() deadlocking. Now allows various consumeProcessXXX variations and pipeTo:

def sout = new StringBuffer()
def serr = new StringBuffer()
proc2 = 'tr -d o'.execute()
proc3 = 'tr -d e'.execute()
proc4 = 'tr -d i'.execute()
proc4.consumeProcessOutput(sout, serr)
proc2 | proc3 | proc4
[proc2, proc3].each{ it.consumeProcessErrorStream(serr) }
proc2.withWriter { writer ->
    writer << 'testfile.groovy'
}
proc4.waitForOrKill(1000)
println 'sout: ' + sout
println 'serr: ' + serr

Issue Links

Activity

Hide
Paul King added a comment -

Just a note that this still needs more documentation.

Show
Paul King added a comment - Just a note that this still needs more documentation.
Hide
Paul King added a comment -

Some initial documentation has been added. Though further improvement would be welcome.

Show
Paul King added a comment - Some initial documentation has been added. Though further improvement would be welcome.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: