Commit 91ddd251 authored by René Schöne's avatar René Schöne
Browse files

Use packged ragconnect, remove root node.

parent 05ce1d2e
...@@ -17,12 +17,21 @@ mainClassName = 'de.tudresden.inf.st.mrc.MinimalMain' ...@@ -17,12 +17,21 @@ mainClassName = 'de.tudresden.inf.st.mrc.MinimalMain'
repositories { repositories {
jcenter() jcenter()
maven {
name "gitlab-maven"
url "https://gitlab.example.com/api/v4/groups/jastadd/-/packages/maven"
}
} }
apply plugin: 'jastadd' apply plugin: 'jastadd'
configurations { configurations {
baseRuntimeClasspath baseRuntimeClasspath
ragconnectClasspath
}
run {
standardInput = System.in
} }
File genSrc = file("src/gen/java") File genSrc = file("src/gen/java")
...@@ -34,6 +43,7 @@ dependencies { ...@@ -34,6 +43,7 @@ dependencies {
implementation group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version: '1.15' implementation group: 'org.fusesource.mqtt-client', name: 'mqtt-client', version: '1.15'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2' implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.2'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2' implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.2'
ragconnectClasspath group: 'de.tudresden.inf.st', name: 'ragconnect.base', version: '0.2.3'
jastadd2 "org.jastadd:jastadd:2.3.4" jastadd2 "org.jastadd:jastadd:2.3.4"
} }
...@@ -45,16 +55,16 @@ def relastFiles = ["src/gen/jastadd/MinimalModel.relast", "src/gen/jastadd/RagCo ...@@ -45,16 +55,16 @@ def relastFiles = ["src/gen/jastadd/MinimalModel.relast", "src/gen/jastadd/RagCo
// phase: ragConnect // phase: ragConnect
task ragConnect(type: JavaExec) { task ragConnect(type: JavaExec) {
group = 'Build' group = 'Build'
main = '-jar' main = 'org.jastadd.ragconnect.compiler.Compiler'
classpath = configurations.ragconnectClasspath
args([ args([
'libs/ragconnect.jar',
'--verbose',
'--o=src/gen/jastadd', '--o=src/gen/jastadd',
'src/main/jastadd/MinimalModel.relast', 'src/main/jastadd/MinimalModel.relast',
'src/main/jastadd/MinimalModel.connect', 'src/main/jastadd/MinimalModel.connect',
'--rootNode=MinimalModel' '--rootNode=A'
]) ])
} }
// phase: RelAst // phase: RelAst
...@@ -102,7 +112,7 @@ jastadd { ...@@ -102,7 +112,7 @@ jastadd {
} }
cleanGen.doFirst { cleanGen.doFirst {
delete "src/gen/java/org" delete "src/gen/java/de"
delete "src/gen-res/BuildInfo.properties" delete "src/gen-res/BuildInfo.properties"
} }
...@@ -125,6 +135,10 @@ jastadd { ...@@ -125,6 +135,10 @@ jastadd {
extraJastAddOptions = ["--lineColumnNumbers", '--List=JastAddList'] extraJastAddOptions = ["--lineColumnNumbers", '--List=JastAddList']
} }
cleanGen.doFirst {
delete "src/gen/jastadd"
}
// Workflow configuration for phases // Workflow configuration for phases
generateAst.dependsOn relastToJastAdd generateAst.dependsOn relastToJastAdd
relastToJastAdd.dependsOn ragConnect relastToJastAdd.dependsOn ragConnect
MinimalModel ::= A ;
A ::= <Input:String> /<OutputOnA:String>/ B* ; A ::= <Input:String> /<OutputOnA:String>/ B* ;
B ::= /<OutputOnB:String>/ ; B ::= /<OutputOnB:String>/ ;
...@@ -2,9 +2,9 @@ package de.tudresden.inf.st.mrc; ...@@ -2,9 +2,9 @@ package de.tudresden.inf.st.mrc;
import de.tudresden.inf.st.mrc.ast.A; import de.tudresden.inf.st.mrc.ast.A;
import de.tudresden.inf.st.mrc.ast.B; import de.tudresden.inf.st.mrc.ast.B;
import de.tudresden.inf.st.mrc.ast.MinimalModel;
import java.io.IOException; import java.io.IOException;
import java.util.Scanner;
/** /**
* Minimal main. * Minimal main.
...@@ -13,7 +13,6 @@ import java.io.IOException; ...@@ -13,7 +13,6 @@ import java.io.IOException;
*/ */
public class MinimalMain { public class MinimalMain {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
MinimalModel model = new MinimalModel();
A a = new A(); A a = new A();
// set some default value for input // set some default value for input
a.setInput(""); a.setInput("");
...@@ -21,7 +20,6 @@ public class MinimalMain { ...@@ -21,7 +20,6 @@ public class MinimalMain {
B b2 = new B(); B b2 = new B();
a.addB(b1); a.addB(b1);
a.addB(b2); a.addB(b2);
model.setA(a);
// a.OutputOnA -> a.Input // a.OutputOnA -> a.Input
a.addDependencyA(a); a.addDependencyA(a);
...@@ -35,6 +33,9 @@ public class MinimalMain { ...@@ -35,6 +33,9 @@ public class MinimalMain {
b1.connectOutputOnB("mqtt://localhost/b1/out", true); b1.connectOutputOnB("mqtt://localhost/b1/out", true);
b2.connectOutputOnB("mqtt://localhost/b2/out", false); b2.connectOutputOnB("mqtt://localhost/b2/out", false);
while (true) {} // while (true) {}
System.out.println("[Enter] to exit");
Scanner scanner = new Scanner(System.in);
scanner.nextLine();
} }
} }
Supports Markdown
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