Adds option to disable file change watching.
Java 7 file change watching may not be trustworthy with some file
systems, provide an escape hatch.
Change-Id: Ia25326ee2c90677e49d35e5f3b9e271b6487630f
diff --git a/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java b/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
index 9c452fb..1bc2a34 100644
--- a/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
+++ b/dev/core/src/com/google/gwt/dev/resource/impl/DirectoryClassPathEntry.java
@@ -36,6 +36,10 @@
*/
public class DirectoryClassPathEntry extends ClassPathEntry {
+ private static final String GWT_WATCH_FILE_CHANGES_PROPERTY = "gwt.watchFileChanges";
+ private static final boolean WATCH_FILE_CHANGES =
+ Boolean.parseBoolean(System.getProperty(GWT_WATCH_FILE_CHANGES_PROPERTY, "true"));
+
private static class Messages {
static final Message1String DESCENDING_INTO_DIR = new Message1String(
TreeLogger.SPAM, "Descending into dir: $0");
@@ -91,6 +95,10 @@
@Override
public Map<AbstractResource, ResourceResolution> findApplicableResources(TreeLogger logger,
PathPrefixSet pathPrefixSet) {
+ if (!WATCH_FILE_CHANGES) {
+ return scanRecursiveDirectory(logger, pathPrefixSet);
+ }
+
ensureListening(logger, pathPrefixSet);
if (listeningFailed) {