From 3fd97cf393a4efaa594dd5514b30432c66f5f55a Mon Sep 17 00:00:00 2001 From: Emil Gabrovski Date: Mon, 27 Mar 2023 10:43:42 +0300 Subject: [PATCH 1/2] CORE-12019 Capture CPI build errors simple impl from Graham --- buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java b/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java index 96140ef..1833875 100644 --- a/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java +++ b/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java @@ -217,6 +217,12 @@ public class BuildCPIsHelper { // } // fileWriter.close(); +// todo: in the meantime, here is a simple working impl + + //Get CPI packaging errors + if (proc.getErrorStream().available() > 0) { + proc.getErrorStream().transferTo(pc.out); + } } private void createNotaryCPI() throws CsdeException, IOException, InterruptedException { From e65ed7617c4719537e7b03f7d557ab4207336c88 Mon Sep 17 00:00:00 2001 From: Emil Gabrovski Date: Wed, 29 Mar 2023 13:25:51 +0300 Subject: [PATCH 2/2] CORE-12019 Fix PR comments --- .../src/main/java/com/r3/csde/BuildCPIsHelper.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java b/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java index 1833875..c160870 100644 --- a/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java +++ b/buildSrc/src/main/java/com/r3/csde/BuildCPIsHelper.java @@ -205,20 +205,6 @@ public class BuildCPIsHelper { Process proc = pb.start(); proc.waitFor(); -// todo: work out how to capture error code better than the following code - -// BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); -// File tempOutputFile = new File(String.format("%s/tempOutput.txt", pc.devEnvWorkspace)); -// tempOutputFile.delete(); -// FileWriter fileWriter = new FileWriter(tempOutputFile); -// String line; -// while (( line = reader.readLine()) != null){ -// fileWriter.write(line + "\n"); -// } -// fileWriter.close(); - -// todo: in the meantime, here is a simple working impl - //Get CPI packaging errors if (proc.getErrorStream().available() > 0) { proc.getErrorStream().transferTo(pc.out);