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

Fixed clean building federated programs #2247

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion core/src/main/java/org/lflang/generator/GeneratorBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ public void reportCommandErrors(String stderr) {

/** Check if a clean was requested from the standalone compiler and perform the clean step. */
protected void cleanIfNeeded(LFGeneratorContext context) {
if (context.getArgs().clean()) {
if (context.isCleanRequested()) {
try {
context.getFileConfig().doClean();
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ enum Mode {
/** Get the error reporter for this context; construct one if it hasn't been constructed yet. */
MessageReporter getErrorReporter();

/** Return true if the user requested a clean build in this context. */
default boolean isCleanRequested() {
return getArgs().clean();
}

/**
* Mark the code generation process performed in this context as finished with the result {@code
* result}.
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/org/lflang/generator/SubContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public SubContext(
this.endPercentProgress = endPercentProgress;
}

@Override
public boolean isCleanRequested() {
return false;
} /// never clean in a sub context

@Override
public CancelIndicator getCancelIndicator() {
return containingContext.getCancelIndicator();
Expand Down
Loading