Adapt generators to new templates

parent 450898ad
......@@ -43,7 +43,6 @@ public class CMakeGenerator extends StarBridgeGenerator {
getGeneratorImpls().stream()
.filter(gen -> gen.willAccept(componentInstanceSymbol))
.map(this::getImplSubdir)
.sorted()
.forEach(subdir -> content.append("add_subdirectory(" + subdir + ")\n"));
......
......@@ -7,18 +7,28 @@ import de.se_rwth.commons.logging.Log;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class StarBridgeGenerator implements GeneratorImpl {
private Map<GeneratorImpl, String> generatorImpls = new HashMap<>();
private List<GeneratorImpl> generators = new ArrayList<>();
String generationTargetPath;
public void add(GeneratorImpl generator, String subdir) {
generators.add(generator);
generatorImpls.put(generator, subdir);
}
public Set<GeneratorImpl> getGeneratorImpls() {
return generatorImpls.keySet();
public void add(GeneratorImpl generator, String subdir, int i) {
generators.add(i, generator);
generatorImpls.put(generator, subdir);
}
public List<GeneratorImpl> getGeneratorImpls() {
return generators;
}
public String getImplSubdir(GeneratorImpl generator) {
......@@ -36,7 +46,8 @@ public class StarBridgeGenerator implements GeneratorImpl {
public List<File> generate(EMAComponentInstanceSymbol componentInstanceSymbol, TaggingResolver taggingResolver) throws IOException {
List<File> result = new ArrayList<>();
generatorImpls.forEach((key, value) -> {
generators.forEach(key -> {
String value = generatorImpls.get(key);
if (key.willAccept(componentInstanceSymbol)) {
String fullTargetPath = generationTargetPath;
if (value != 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