Version up; Write preprocessed models to file

parent 5aed51e2
Pipeline #184318 failed with stages
in 1 minute and 39 seconds
......@@ -10,7 +10,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-middleware-generator</artifactId>
<version>0.0.27-SNAPSHOT</version>
<version>0.0.28-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -20,12 +20,12 @@
<!-- .. SE-Libraries .................................................. -->
<se-commons.version>1.7.7</se-commons.version>
<embedded-montiarc.version>0.1.14-SNAPSHOT</embedded-montiarc.version>
<embedded-montiarc.version>0.1.16-SNAPSHOT</embedded-montiarc.version>
<Embedded-montiarc-math-generator.version>0.1.14-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-montiarc-math-roscpp-generator.version>0.1.6-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version>
<EMADL2CPP.version>0.3.6-SNAPSHOT</EMADL2CPP.version>
<EMADL.version>0.2.10-SNAPSHOT</EMADL.version>
<embedded-montiarc-component-clustering.version>0.0.2-SNAPSHOT</embedded-montiarc-component-clustering.version>
<embedded-montiarc-component-clustering.version>0.0.3-SNAPSHOT</embedded-montiarc-component-clustering.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
......
......@@ -2,6 +2,7 @@
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.helper.SymbolPrinter;
import de.monticore.lang.monticar.clustering.AutomaticClusteringHelper;
import de.monticore.lang.monticar.clustering.ClusteringResult;
import de.monticore.lang.monticar.clustering.ClusteringResultList;
......@@ -16,6 +17,7 @@ import de.monticore.lang.monticar.generator.middleware.impls.*;
import de.monticore.lang.monticar.generator.middleware.templates.compile.CompilationGenerator;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.se_rwth.commons.logging.Log;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
......@@ -105,6 +107,10 @@ public class DistributedTargetGenerator{
middlewareTagGen.setGenerationTargetPath(generationTargetPath + "emam/");
middlewareTagGen.setClusteringResults(clusteringResults);
files.addAll(middlewareTagGen.generate(componentInstanceSymbol,taggingResolver));
File file = saveModel(componentInstanceSymbol);
files.add(file);
}
files.addAll(completeGenerator.generate(componentInstanceSymbol, taggingResolver));
......@@ -112,6 +118,17 @@ public class DistributedTargetGenerator{
return files;
}
private File saveModel(EMAComponentInstanceSymbol componentInstance) throws IOException {
String name = componentInstance.getName().substring(0,1).toUpperCase() + componentInstance.getName().substring(1);
String pathname = generationTargetPath + "/emam/model/" + name + ".emam";
Log.info("Writing component into file: " + pathname, "files");
String modelData = SymbolPrinter.printEMAComponentInstanceAsEMAComponent(componentInstance);
File file = new File(pathname);
file.getParentFile().mkdirs();
FileUtils.write(file, modelData,"UTF-8");
return file;
}
private EMAComponentInstanceSymbol preprocessing(EMAComponentInstanceSymbol genComp) {
EMAComponentInstanceSymbol componentInstanceSymbol = genComp;
if(clusteringParameters != null){
......
Markdown is supported
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