...
 
Commits (9)

Too many changes to show.

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

# (c) https://github.com/MontiCore/monticore
stages:
- windows
- linuxCompile
......
<!-- (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.27-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -19,11 +20,11 @@
<!-- .. 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.version>0.1.14-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.2.8</EMADL2CPP.version>
<EMADL.version>0.2.7-SNAPSHOT</EMADL.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>
<!-- .. Libraries .................................................. -->
......
<?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;
......
/* (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;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
import java.util.Optional;
......@@ -55,5 +56,4 @@ public class CliParameters {
public Optional<ClusteringParameters> getClusteringParameters() {
return Optional.ofNullable(clusteringParameters);
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
import com.google.gson.*;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
import de.monticore.lang.monticar.clustering.cli.algorithms.AlgorithmCliParameters;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
import com.google.gson.Gson;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
public enum ResultChoosingStrategy {
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.cli;
import com.google.gson.*;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.helpers;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConnectorSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.helpers;
import de.monticore.lang.monticar.generator.FileContent;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.helpers;
public class NameHelper {
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.helpers;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.helpers;
import de.se_rwth.commons.logging.Log;
......@@ -18,7 +19,7 @@ public class TemplateHelper {
String resourceFileName = "/de/monticore/lang/monticar/generator/middleware/templates/" + fileName;
try {
tmpStr = IOUtils.toString(TemplateHelper.class.getResourceAsStream(resourceFileName));
tmpStr = IOUtils.toString(TemplateHelper.class.getResourceAsStream(resourceFileName)).replaceAll("<#--[^>]*-->", "");
} catch (Exception e) {
//Not recoverable
Log.error("Template file not found: " + resourceFileName);
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.MiddlewareSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......@@ -10,9 +11,7 @@ import de.se_rwth.commons.logging.Log;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
public class EMADLGeneratorImpl implements GeneratorImpl {
private String generationTargetPath;
......@@ -36,7 +35,8 @@ public class EMADLGeneratorImpl implements GeneratorImpl {
List<File> files = new ArrayList<>();
emadlGenerator.setGenerationTargetPath(generationTargetPath);
List<FileContent> fileContents = emadlGenerator.generateStrings(taggingResolver, componentInstanceSymbol, taggingResolver);
List<FileContent> fileContents = emadlGenerator.generateStrings(taggingResolver, componentInstanceSymbol,
taggingResolver, new HashSet<>(), "n");
for (FileContent fileContent : fileContents) {
files.add(emadlGenerator.getEmamGen().generateFile(fileContent));
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.impls;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates;
import de.monticore.lang.monticar.generator.middleware.templates.compile.BashCompilationGenerator;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
import de.monticore.lang.monticar.generator.FileContent;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
import de.monticore.lang.monticar.generator.middleware.templates.MiddlewareTemplates;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
import de.monticore.lang.monticar.generator.middleware.templates.MiddlewareTemplates;
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.middleware.templates.compile;
import de.monticore.lang.monticar.generator.FileContent;
......
<#-- (c) https://github.com/MontiCore/monticore -->
#pragma once
#include "${compName}.h"
......
<#-- (c) https://github.com/MontiCore/monticore -->
<#-- General batch -->
<#macro comment str>
:: ${str}
......@@ -34,4 +35,4 @@ IF NOT %ERRORLEVEL% EQU 0 (
</#if>
@echo off
<#include "compile.general.ftl"/>
\ No newline at end of file
<#include "compile.general.ftl"/>
<#-- (c) https://github.com/MontiCore/monticore -->
<#macro cmake subdir="">
<@comment str="configure cmake"/>
cmake -B<@evalCurDir postfix="build/${subdir}"/> -H<@evalCurDir postfix="src/${subdir}"/> -DCMAKE_INSTALL_PREFIX=<@evalCurDir postfix="install"/> <@generatorOption/> <@passParams/>
......@@ -36,4 +37,4 @@ popd
<@cmake subdir="comps"/>
<#else>
<@cmake/>
</#if>
\ No newline at end of file
</#if>
<#-- (c) https://github.com/MontiCore/monticore -->
#!/usr/bin/env bash
set -e
export CMAKE_PREFIX_PATH=$AMENT_PREFIX_PATH:$CMAKE_PREFIX_PATH
......@@ -36,4 +37,4 @@ fi
</#macro>
<#macro generatorOption></#macro>
<#include "compile.general.ftl"/>
\ No newline at end of file
<#include "compile.general.ftl"/>