Skip to content

Commit

Permalink
Critical fix: Use script file with build config in compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed Jan 3, 2024
1 parent 0f5c389 commit ec0a9e5
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,17 @@ protected void println(String s) {
protected File compileScript(WurstGui gui, ModelManager modelManager, List<String> compileArgs, Optional<File> mapCopy,
WurstProjectConfigData projectConfigData, boolean isProd, File scriptFile) throws Exception {
RunArgs runArgs = new RunArgs(compileArgs);

Optional<CompilationUnit> war3mapJ = modelManager.getModel()
.stream()
.filter((CompilationUnit cu) -> cu.getCuInfo().getFile().endsWith("war3map.j"))
.findFirst();

if (war3mapJ.isPresent()) {
modelManager.syncCompilationUnitContent(WFile.create(war3mapJ.get().getCuInfo().getFile()),
java.nio.file.Files.readString(scriptFile.toPath()));
}

gui.sendProgress("Compiling Script");
print("Compile Script : ");
for (File dep : modelManager.getDependencyWurstFiles()) {
Expand Down

0 comments on commit ec0a9e5

Please sign in to comment.