Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI args propagated to federates #1604

Merged
merged 4 commits into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions org.lflang/src/org/lflang/TargetProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ public enum TargetProperty {
}
}),


/**
* Directive to let the runtime export its internal dependency graph.
*
Expand Down Expand Up @@ -876,7 +875,7 @@ private interface PropertyGetter {
this.supportedBy = supportedBy;
this.getter = getter;
this.setter = setter;
this.updater = (config, value, err) -> { /* Ignore the update by default */ };
this.updater = setter; // (Re)set by default
}

/**
Expand Down
10 changes: 8 additions & 2 deletions org.lflang/src/org/lflang/federated/generator/FedGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.lflang.generator.CodeMap;
import org.lflang.generator.DockerData;
import org.lflang.generator.FedDockerComposeGenerator;
import org.lflang.generator.GeneratorResult;
import org.lflang.generator.GeneratorResult.Status;
import org.lflang.generator.GeneratorUtils;
import org.lflang.generator.IntegratedBuilder;
Expand Down Expand Up @@ -170,12 +171,17 @@ public boolean doGenerate(Resource resource, LFGeneratorContext context) throws
));
}

if (context.getTargetConfig().noCompile) {
context.finish(Status.GENERATED, lf2lfCodeMapMap);
return false;
}

Map<Path, CodeMap> codeMapMap = compileFederates(context, lf2lfCodeMapMap, (subContexts) -> {
if (context.getTargetConfig().dockerOptions == null) return;
final List<DockerData> services = new ArrayList();
// 1. create a Dockerfile for each federate
subContexts.forEach((subContext) -> {
// Inherit Docker properties from main context
// Inherit Docker options from main context
subContext.getTargetConfig().dockerOptions = context.getTargetConfig().dockerOptions;
var dockerGenerator = dockerGeneratorFactory(subContext);
var dockerData = dockerGenerator.generateDockerData();
Expand All @@ -198,7 +204,7 @@ public boolean doGenerate(Resource resource, LFGeneratorContext context) throws
});

context.finish(Status.COMPILED, codeMapMap);
return false; // FIXME why false?
return false;
}

/**
Expand Down