Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JastAdd
ros2rag
Commits
effb5d3c
Commit
effb5d3c
authored
May 08, 2020
by
René Schöne
Browse files
Ensure in RelastTest, that output directories are created.
parent
1542e409
Pipeline
#6552
failed with stage
in 1 minute and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
buildSrc/src/main/java/org/jastadd/relast/plugin/RelastTest.java
View file @
effb5d3c
...
...
@@ -8,6 +8,9 @@ import org.gradle.api.tasks.SourceSet;
import
org.gradle.api.tasks.SourceSetContainer
;
import
org.gradle.api.tasks.TaskAction
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
...
...
@@ -165,7 +168,7 @@ public class RelastTest extends DefaultTask {
private
String
[]
genSuffixes
=
{
".ast"
,
".jadd"
,
"RefResolver.jadd"
,
"ResolverStubs.jrag"
,
"Serializer.jadd"
};
@TaskAction
void
runTest
()
{
void
runTest
()
throws
IOException
{
setGroup
(
"verification"
);
setDescription
(
"Runs a relast test"
);
Project
project
=
getProject
();
...
...
@@ -188,6 +191,9 @@ public class RelastTest extends DefaultTask {
deleteSpec
.
delete
(
Paths
.
get
(
getOutputDir
(),
getPackageName
()));
}
});
// create output directories, if not existing
createDirectory
(
Paths
.
get
(
getOutputDir
()));
createDirectory
(
Paths
.
get
(
getGrammarName
()).
getParent
());
if
(
isVerbose
())
{
System
.
out
.
println
(
"Pre processing, running relast"
);
}
...
...
@@ -261,4 +267,13 @@ public class RelastTest extends DefaultTask {
}
}
private
void
createDirectory
(
Path
path
)
throws
IOException
{
try
{
Files
.
createDirectories
(
path
);
}
catch
(
IOException
e
)
{
System
.
err
.
println
(
"Could not create output directory "
+
path
);
throw
e
;
}
}
}
Write
Preview
Supports
Markdown
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