Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
EMADL2CPP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
EMADL2CPP
Commits
f509c7c1
Commit
f509c7c1
authored
Mar 09, 2019
by
Christopher Jan-Steffen Brix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abort on compilation error
parent
3acf4b3c
Pipeline
#110318
failed with stages
in 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
29 deletions
+32
-29
src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java
...nticore/lang/monticar/emadl/generator/EMADLGenerator.java
+32
-29
No files found.
src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java
View file @
f509c7c1
...
...
@@ -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
(
"c
d "
+
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
(
"csss
d "
+
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment