Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class CliBuildMap extends MapRequest {
public CliBuildMap(WFile workspaceRoot, Optional<File> map, List<String> compileArgs, Optional<String> wc3Path, WurstGui gui) {
super(null, map, compileArgs, workspaceRoot, wc3Path, Optional.empty());
this.gui = gui;
this.rebuildModelBeforeCompile = false;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ public abstract class MapRequest extends UserRequest<Object> {
*/
protected SafetyLevel safeCompilation = SafetyLevel.KindOfSafe;

/**
* Whether compiling first cleans and rebuilds the project model. That discards state from the editor,
* which a CLI build does not have: it has built the model itself immediately before.
*/
protected boolean rebuildModelBeforeCompile = true;

public TimeTaker getTimeTaker() {
return timeTaker;
}
Expand Down Expand Up @@ -380,7 +386,7 @@ protected File compileScript(WurstGui gui, ModelManager modelManager, List<Strin
WLogger.debug("dep: " + dep.getPath());
}
print("Dependencies done.");
if (safeCompilation != RunMap.SafetyLevel.QuickAndDirty) {
if (safeCompilation != RunMap.SafetyLevel.QuickAndDirty && rebuildModelBeforeCompile) {
// it is safer to rebuild the project, instead of taking the current editor state
gui.sendProgress("Cleaning project");
modelManager.clean();
Expand Down
Loading