Skip to content

Commit

Permalink
synchronize the reporter output so the outputs of a multi-project par…
Browse files Browse the repository at this point in the history
…allel build don't get mixed up (refs #18)
  • Loading branch information
jochenberger committed Dec 10, 2013
1 parent a0b29cb commit b3925f6
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class DependencyUpdatesReporter {
/** The dependencies that could not be resolved. */
def unresolved

private static Object mutex = new Object();

/** Writes the report to the console. */
def writeToConsole() {
writeTo(System.out)
Expand All @@ -62,11 +64,13 @@ class DependencyUpdatesReporter {

/** Writes the report to the print stream. The stream is not automatically closed. */
def writeTo(printStream) {
writeHeader(printStream)
writeUpToDate(printStream)
writeExceedLatestFound(printStream)
writeUpgrades(printStream)
writeUnresolved(printStream)
synchronized (mutex) {
writeHeader(printStream)
writeUpToDate(printStream)
writeExceedLatestFound(printStream)
writeUpgrades(printStream)
writeUnresolved(printStream)
}
}

private def writeHeader(printStream) {
Expand Down

0 comments on commit b3925f6

Please sign in to comment.