...
 
Commits (63)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# (c) https://github.com/MontiCore/monticore
stages:
- windows
- linuxCompile
......@@ -33,6 +34,14 @@ DeployJobLinux:
only:
- master
MqttIntegrationJob:
stage: integration
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2mqtt:v1
dependencies:
- CompileJobLinux
script:
- ./src/test/bash/integrationTestMqtt.sh
RosIntegrationJob:
stage: integration
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2middleware/ema-ros-kinetic
......@@ -41,6 +50,14 @@ RosIntegrationJob:
script:
- ./src/test/bash/integrationTestRos.sh
SomeIPIntegrationJob:
stage: integration
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2someip:v2
dependencies:
- CompileJobLinux
script:
- ./src/test/bash/integrationTestSomeIP.sh
Ros2IntegrationJob:
stage: integration
image: registry.git.rwth-aachen.de/monticore/embeddedmontiarc/generators/emam2middleware/ema-ros-crystal
......
<!-- (c) https://github.com/MontiCore/monticore -->
# Dependencies needed to compile the generated projects
## Note
The generator creates compile scripts for all supported compilers. A project with ROS or ROS2 contains `compile.sh` and `compileMsbuild.bat` as Linux and Windows(with Msbuild) are supported.
......
<!-- (c) https://github.com/MontiCore/monticore -->
# Quickstart guide for generator developers
- Download and install Java(8+), Maven, as well as Git.
- Clone this repository:
......@@ -21,4 +22,4 @@
## Compiling the Projects
Options
1. Add your new generated test projects to the integration tests(check the scripts in [src/test/bash/](src/test/bash/) as well as [.gitlab-ci.yml](.gitlab-ci.yml)) and let the CI/CD system compile them. Alternatively you can use Docker to run the integration tests locally(reference [README.md](README.md) , Section 'Running the Integration tests locally')
2. Install all dependencies (reference [README.md](README.md) , Section 'Dependencies needed to compile the generated projects') and execute the generated compile scripts.
\ No newline at end of file
2. Install all dependencies (reference [README.md](README.md) , Section 'Dependencies needed to compile the generated projects') and execute the generated compile scripts.
<!-- (c) https://github.com/MontiCore/monticore -->
# Quickstart guide for generator users
- Download the latest version of the generator from the [se-nexus](https://nexus.se.rwth-aachen.de/service/rest/repository/browse/public/de/monticore/lang/monticar/embedded-montiarc-math-middleware-generator/) (e.g. .../0.0.20-20190311.154342-1/embedded-montiarc-math-middleware-generator-0.0.20-20190311.154342-1-jar-with-dependencies.jar) and save it as mw-generator.jar
- Create a `project.json` config file for your project
......@@ -25,4 +26,4 @@ call substCompileMingw.bat
For two example Projects using this generator see:
- [Cooperative Intersection](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/applications/cooperativeintersection) (Uses EMAM, ROS, CoInCar Simulator)
- [Autonomous driving](https://git.rwth-aachen.de/autonomousdriving/torcs_dl) (Uses EMADL, ROS, Torcs Simulator)
\ No newline at end of file
- [Autonomous driving](https://git.rwth-aachen.de/autonomousdriving/torcs_dl) (Uses EMADL, ROS, Torcs Simulator)
<!-- (c) https://github.com/MontiCore/monticore -->
# EMAM2Middleware
![pipeline](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMAM2Middleware/badges/master/build.svg)
![coverage](https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/generators/EMAM2Middleware/badges/master/coverage.svg)
......@@ -36,7 +37,7 @@ An example config file with all clustering algorithms: [config](src/test/resourc
| outputDir | String | ✅ | path to output directory for generated files |
| rootModel | String | ✅ | fully qualified name of the root model |
| generators | List | ✅ | List of generator identfiers<br> 'cpp', 'emadlcpp', 'roscpp', 'rclcpp' |
| emadlBackend | String | ❓ | deep-learning-framework backend<br> 'MXNET'(Default), 'CAFFE2' |
| emadlBackend | String | ❓ | deep-learning-framework backend<br> 'MXNET'(Default), 'CAFFE2', 'GLUON' |
| writeTagFile | Bool | ❓ | Writes a .tag file with all Middleware tags into the generated code<br> Defaults to false |
| clusteringParameters | Object | ❓ | Options to cluster the component before generating<br> See below |
......@@ -146,4 +147,4 @@ Run the tests by executing [dockerLocalIntegrationTestRos.sh](src/test/bash/dock
```bash
sudo src/test/bash/dockerLocalIntegrationTestRos.sh
sudo src/test/bash/dockerLocalIntegrationTestRos2.sh
```
\ No newline at end of file
```
<!-- (c) https://github.com/MontiCore/monticore -->
# Adding a new middleware generator
## EmbeddedMontiArc
......
<!-- (c) https://github.com/MontiCore/monticore -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
......@@ -9,7 +10,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-middleware-generator</artifactId>
<version>0.0.25-SNAPSHOT</version>
<version>0.0.33-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -18,12 +19,14 @@
<!-- .. SE-Libraries .................................................. -->
<se-commons.version>1.7.7</se-commons.version>
<embedded-montiarc.version>0.1.9-SNAPSHOT</embedded-montiarc.version>
<Embedded-montiarc-math-generator.version>0.1.12-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.2.8</EMADL2CPP.version>
<EMADL.version>0.2.7-SNAPSHOT</EMADL.version>
<embedded-montiarc.version>0.1.19-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.8-SNAPSHOT</Embedded-montiarc-math-roscpp-generator.version>
<EMADL2CPP.version>0.3.7-SNAPSHOT</EMADL2CPP.version>
<EMADL.version>0.2.10-SNAPSHOT</EMADL.version>
<SOMEIP.version>1.3-SNAPSHOT</SOMEIP.version>
<MQTT.version>1.5-SNAPSHOT</MQTT.version>
<embedded-montiarc-component-clustering.version>0.0.2-SNAPSHOT</embedded-montiarc-component-clustering.version>
<!-- .. Libraries .................................................. -->
......@@ -106,6 +109,18 @@
<version>${Embedded-montiarc-math-roscpp-generator.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-emam2someip-generator</artifactId>
<version>${SOMEIP.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-mqtt-generator</artifactId>
<version>${MQTT.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) https://github.com/MontiCore/monticore -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
......@@ -83,4 +84,4 @@
<activeProfiles>
<activeProfile>se-nexus</activeProfile>
</activeProfiles>
</settings>
\ No newline at end of file
</settings>
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
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;
......@@ -15,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;
......@@ -104,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));
......@@ -111,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: " +