Aufgrund einer Wartung wird GitLab am 28.09. zwischen 10:00 und 11:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 28.09. between 10:00 and 11:00 am.

Abort on compilation error

parent 3acf4b3c
Pipeline #110318 failed with stages
in 45 seconds
......@@ -134,39 +134,42 @@ public class EMADLGenerator {
}
public void executeCommands() throws IOException {
File tempScript = createTempScript();
try {
ProcessBuilder pb = new ProcessBuilder("bash", tempScript.toString());
pb.inheritIO();
Process process = pb.start();
process.waitFor();
}catch(Exception e){
System.out.println(e);
} finally {
tempScript.delete();
}
File tempScript = createTempScript();
try {
ProcessBuilder pb = new ProcessBuilder("bash", tempScript.toString());
pb.inheritIO();
Process process = pb.start();
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){
Log.error("During compilation, the following error occured: '" + e.toString() + "'");
System.exit(1);
} finally {
tempScript.delete();
}
}
public File createTempScript() throws IOException{
File tempScript = File.createTempFile("script", null);
try{
Writer streamWriter = new OutputStreamWriter(new FileOutputStream(
File tempScript = File.createTempFile("script", null);
try{
Writer streamWriter = new OutputStreamWriter(new FileOutputStream(
tempScript));
PrintWriter printWriter = new PrintWriter(streamWriter);
printWriter.println("#!/bin/bash");
printWriter.println("cd " + getGenerationTargetPath());
printWriter.println("mkdir --parents build");
printWriter.println("cd build");
printWriter.println("cmake ..");
printWriter.println("make");
printWriter.close();
}catch(Exception e){
System.out.println(e);
}
PrintWriter printWriter = new PrintWriter(streamWriter);
printWriter.println("#!/bin/bash");
printWriter.println("csssd " + getGenerationTargetPath());
printWriter.println("mkdir --parents build");
printWriter.println("cd build");
printWriter.println("cmake ..");
printWriter.println("make");
printWriter.close();
}catch(Exception e){
System.out.println(e);
}
return tempScript;
}
......
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