Commit 32308084 authored by Johannes Mey's avatar Johannes Mey
Browse files

update task

parent 04558b5b
......@@ -21,7 +21,11 @@ configurations {
File genSrc = file("src/gen/java")
idea.module.generatedSourceDirs += genSrc
sourceSets.main.java.srcDir genSrc
//jar.manifest.attributes('Main-Class': 'de.tudresden.inf.st.statemachine.Main')
jar {
from { sourceSets.main.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
manifest.attributes('Main-Class': 'de.tudresden.inf.st.statemachine.Main')
}
dependencies {
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_version}"
......@@ -29,7 +33,7 @@ dependencies {
implementation group: 'de.tudresden.inf.st', name: 'dumpAstWithPlantuml', version: '0.3.5'
jastadd2 "org.jastadd:jastadd:2.3.4"
ragdoc files('../libs/rd-builder.jar')
ragdoc files('../libs/rd-builder-1.3.0.jar')
}
// Default run configuration
......@@ -58,6 +62,29 @@ task ecoreToRelast(type: JavaExec) {
outputs.files file(relastFile)
}
task('ragdoc-java-8', type: JavaExec, group: 'documentation') {
description 'Generates RagDoc metadata for this JastAdd project.'
inputs.files {
sourceSets.main.allJava.files
}
main = 'org.extendj.ragdoc.RagDocBuilder'
doFirst {
def destDir = new File(docsDir, 'ragdoc')
if (!destDir.isDirectory()) {
destDir.mkdirs()
}
classpath = configurations.ragdoc
def sourceFiles = sourceSets.main.allJava.files
args(['-d', "$destDir",
'-bootclasspath', '/usr/lib/jvm/java-1.8.0/jre/lib/rt.jar',
] + sourceFiles)
}
}
// Second phase: RelAst -> JastAdd
task relastToJastAdd(type: JavaExec) {
group = 'Build'
......
aspect StateMachinetoDotG {
syn String StateMachine.toDot() {
StringBuilder b = new StringBuilder();
b.append("strict digraph cycles {\n");
for (State from : states()) {
b.append(" ").append(from.getLabel()).append("[label=\"").append(from.getLabel()).append("\"];\n");
for (Transition out : from.getOutgoingList()) {
b.append(" ").append(from.getLabel()).append(" -> ").append(out.getTo().getLabel())
.append("[label=\"").append(out.getLabel()).append("\"];\n");
}
}
b.append("}\n");
return b.toString();
}
}
......@@ -41,6 +41,8 @@ public class Main {
printHeading("StateMachine after");
System.out.println(stateMachine.prettyPrint());
}
printHeading("DotGraph");
System.out.println(stateMachine.toDot());
Dumper.read(stateMachine).dumpAsPNG(Paths.get("02-transformed.png"));
DrAST_root_node = stateMachine;
}
......
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