/** Sends the accumulated log in {@link SplittableBuildListener} to the log of this build. */ public void appendLastLog() { try { sync(); listener.setSideOutputStream(log); listener.setSideOutputStream(null); } catch (IOException e) { e.printStackTrace(); } }
/** * Before we touch I/O streams, we need to make sure all the remote I/O operations are locally * completed, or else we end up switching the log traffic at unaligned moments. */ private void sync() throws IOException { try { Channel ch = Channel.current(); if (ch != null) listener.synchronizeOnMark(ch); } catch (InterruptedException e) { // our signature doesn't allow us to throw InterruptedException, so we process it later Thread.currentThread().interrupt(); } }
public void start() { onStartBuilding(); startTime = System.currentTimeMillis(); try { sync(); listener.setSideOutputStream(log); } catch (IOException e) { e.printStackTrace(); } }
public void end() { if (result == null) setResult(Result.SUCCESS); onEndBuilding(); duration += System.currentTimeMillis() - startTime; parentBuild.notifyModuleBuild(MavenBuild.this); try { sync(); listener.setSideOutputStream(null); save(); } catch (IOException e) { e.printStackTrace(); } }