Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Kurz <[email protected]>
  • Loading branch information
scottkurz committed Aug 14, 2023
1 parent d83810f commit 001d962
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -976,15 +977,23 @@ public boolean recompileBuildFile(File buildFile, Set<String> compileArtifactPat

}

// SKSK new
// We don't currently have the ability to dynamically add new directories to be watched
// There is so much that we are dynamically able to do that this could be surprising.
// For now issue a warning
Set<Path> oldMonitoredWebResourceDirs = new HashSet<Path>(this.monitoredWebResourceDirs);
Set<Path> newMonitoredWebResourceDirs = new HashSet<Path>(LooseWarApplication.getWebSourceDirectoriesToMonitor(project));
if (oldMonitoredWebResourceDirs.equals(newMonitoredWebResourceDirs)) {
System.out.println("SKSK: Issue warning for web res");
if (!oldMonitoredWebResourceDirs.equals(newMonitoredWebResourceDirs)) {
getLog().warn("Change detected in the set of filtered web resource directories. Adding/deleting such a directory has no change on the set of directories monitored by dev mode. Changing the watch list will require a dev mode restart");
}



// convert to Path, which seems to offer more reliable cross-platform, relative path comparison, then compare
Set<Path> oldResourceDirs = new HashSet<Path>();
this.resourceDirs.forEach(r -> oldResourceDirs.add(r.toPath()));
Set<Path> newResourceDirs = new HashSet<Path>();
project.getResources().forEach(r -> newResourceDirs.add(Paths.get(r.getDirectory())));
if (!oldResourceDirs.equals(newResourceDirs)) {
getLog().warn("Change detected in the set of resource directories. Adding/deleting such a directory has no change on the set of directories monitored by dev mode. Changing the watch list will require a dev mode restart");
}

if (restartServer) {
// - stop Server
Expand Down

0 comments on commit 001d962

Please sign in to comment.