Skip to content
Snippets Groups Projects
Commit 31d6724e authored by René Schöne's avatar René Schöne
Browse files

0.2.13

- try to get configurations to work
- specify default values for boolean settings
parent 707ee81c
No related branches found
No related tags found
No related merge requests found
Pipeline #12914 passed
...@@ -98,16 +98,16 @@ public abstract class RagConnectTest extends RelastTest { ...@@ -98,16 +98,16 @@ public abstract class RagConnectTest extends RelastTest {
} }
args.add("--o=" + getRagconnect().getOutputDir()); args.add("--o=" + getRagconnect().getOutputDir());
args.add("--rootNode=" + getRagconnect().getRootNode()); args.add("--rootNode=" + getRagconnect().getRootNode());
if (isTrue(getRagconnect().isLogReads())) { if (valueOf(getRagconnect().isLogReads(), false)) {
args.add("--logReads"); args.add("--logReads");
} }
if (isTrue(getRagconnect().isLogWrites())) { if (valueOf(getRagconnect().isLogWrites(), false)) {
args.add("--logWrites"); args.add("--logWrites");
} }
if (isTrue(getRagconnect().isLogIncremental())) { if (valueOf(getRagconnect().isLogIncremental(), false)) {
args.add("--logIncremental"); args.add("--logIncremental");
} }
if (isTrue(getRagconnect().isVerbose())) { if (valueOf(getRagconnect().isVerbose(), false)) {
args.add("--verbose"); args.add("--verbose");
} }
if (getRagconnect().getProtocols() != null && !getRagconnect().getProtocols().isEmpty()) { if (getRagconnect().getProtocols() != null && !getRagconnect().getProtocols().isEmpty()) {
......
...@@ -76,12 +76,8 @@ public abstract class RelastTest extends DefaultTask { ...@@ -76,12 +76,8 @@ public abstract class RelastTest extends DefaultTask {
runTest(); runTest();
} }
protected boolean isTrue(Boolean b) { protected boolean valueOf(Boolean b, boolean defaultValue) {
return b != null && b; return b != null ? b : defaultValue;
}
protected boolean isFalse(Boolean b) {
return b != null && !b;
} }
boolean isVerbose() { boolean isVerbose() {
...@@ -131,13 +127,13 @@ public abstract class RelastTest extends DefaultTask { ...@@ -131,13 +127,13 @@ public abstract class RelastTest extends DefaultTask {
args.add(file.getAbsolutePath()); args.add(file.getAbsolutePath());
} }
args.add("--quiet"); args.add("--quiet");
if (isFalse(getRelast().isNoWriteToFile())) { if (!valueOf(getRelast().isNoWriteToFile(), false)) {
args.add("--file"); args.add("--file");
} }
if (isTrue(getRelast().isUseJastAddNames())) { if (valueOf(getRelast().isUseJastAddNames(), true)) {
args.add("--useJastAddNames"); args.add("--useJastAddNames");
} }
if (isFalse(getRelast().isNoResolverHelper())) { if (!valueOf(getRelast().isNoResolverHelper(), false)) {
args.add("--resolverHelper"); args.add("--resolverHelper");
} }
if (getJastadd().getJastAddList() != null) { if (getJastadd().getJastAddList() != null) {
...@@ -152,12 +148,12 @@ public abstract class RelastTest extends DefaultTask { ...@@ -152,12 +148,12 @@ public abstract class RelastTest extends DefaultTask {
args.add("--grammarName=" + pathToAbsoluteProject(getRelast().getGrammarName())); args.add("--grammarName=" + pathToAbsoluteProject(getRelast().getGrammarName()));
args.addAll(getRelast().getExtraOptionsOrDefault()); args.addAll(getRelast().getExtraOptionsOrDefault());
if (isVerbose()) { if (isVerbose()) {
System.out.println("Start relast with args: " + args + " and main: " + javaExecSpec.getMainClass()); System.out.println("Start relast with args: " + args + " and main: " + javaExecSpec.getMainClass().getOrNull());
} }
javaExecSpec.args(args); javaExecSpec.args(args);
}).assertNormalExitValue(); }).assertNormalExitValue();
}); });
if (isTrue(getJastadd().isSkipRun())) { if (valueOf(getJastadd().isSkipRun(), false)) {
if (isVerbose()) { if (isVerbose()) {
System.out.println("Skipping run of JastAdd"); System.out.println("Skipping run of JastAdd");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment