Abort on compilation error

parent 3acf4b3c
Pipeline #110318 failed with stages
in 45 seconds
...@@ -134,16 +134,19 @@ public class EMADLGenerator { ...@@ -134,16 +134,19 @@ public class EMADLGenerator {
} }
public void executeCommands() throws IOException { public void executeCommands() throws IOException {
File tempScript = createTempScript(); File tempScript = createTempScript();
try { try {
ProcessBuilder pb = new ProcessBuilder("bash", tempScript.toString()); ProcessBuilder pb = new ProcessBuilder("bash", tempScript.toString());
pb.inheritIO(); pb.inheritIO();
Process process = pb.start(); Process process = pb.start();
process.waitFor(); int returnCode = process.waitFor();
if(returnCode != 0) {
Log.error("During compilation, an error occured. See above for more details.");
System.exit(1);
}
}catch(Exception e){ }catch(Exception e){
System.out.println(e); Log.error("During compilation, the following error occured: '" + e.toString() + "'");
System.exit(1);
} finally { } finally {
tempScript.delete(); tempScript.delete();
} }
...@@ -157,7 +160,7 @@ public class EMADLGenerator { ...@@ -157,7 +160,7 @@ public class EMADLGenerator {
PrintWriter printWriter = new PrintWriter(streamWriter); PrintWriter printWriter = new PrintWriter(streamWriter);
printWriter.println("#!/bin/bash"); printWriter.println("#!/bin/bash");
printWriter.println("cd " + getGenerationTargetPath()); printWriter.println("csssd " + getGenerationTargetPath());
printWriter.println("mkdir --parents build"); printWriter.println("mkdir --parents build");
printWriter.println("cd build"); printWriter.println("cd build");
printWriter.println("cmake .."); printWriter.println("cmake ..");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment