@@ -885,7 +885,8 @@ public void runmapPurge_onlyKeepsWar3MapFromProjectWurstFolder() throws Exceptio
885885 private void purgeUnimportedFiles_likeRunMap (WurstModel model , ModelManagerImpl manager ) {
886886 java .util .Set <CompilationUnit > keep = model .stream ()
887887 .filter (cu -> isInProjectWurstFolder_likeRunMap (cu .getCuInfo ().getFile (), manager )
888- || isProjectWar3Map_likeRunMap (cu .getCuInfo ().getFile (), manager ))
888+ || isProjectWar3Map_likeRunMap (cu .getCuInfo ().getFile (), manager )
889+ || isRequiredBuildJass_likeRunMap (cu .getCuInfo ().getFile (), manager ))
889890 .collect (java .util .stream .Collectors .toSet ());
890891
891892 // Recursively add imported packages’ CUs (uses attrImportedPackage like RunMap)
@@ -910,6 +911,16 @@ private boolean isProjectWar3Map_likeRunMap(String file, ModelManagerImpl manage
910911 return p .startsWith (w ) && java .nio .file .Files .exists (p );
911912 }
912913
914+ private boolean isRequiredBuildJass_likeRunMap (String file , ModelManagerImpl manager ) {
915+ java .nio .file .Path p = java .nio .file .Paths .get (file ).toAbsolutePath ().normalize ();
916+ java .nio .file .Path buildDir = manager .getProjectPath ().toPath ().resolve ("_build" ).toAbsolutePath ().normalize ();
917+ if (!p .startsWith (buildDir ) || !java .nio .file .Files .exists (p )) {
918+ return false ;
919+ }
920+ String name = p .getFileName ().toString ();
921+ return name .equals ("common.j" ) || name .equals ("blizzard.j" );
922+ }
923+
913924 private void addImports_likeRunMap (java .util .Set <CompilationUnit > result , java .util .Set <CompilationUnit > toAdd ) {
914925 java .util .Set <CompilationUnit > imported =
915926 toAdd .stream ()
0 commit comments