From 2891ec527eed27d0c6460d66f51cb66a43373b6a Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Thu, 13 Oct 2016 11:56:18 +0000 Subject: Make --watchfs a common command option. Adding an options parameter to DiffAwareness#getCurrentView seems like the simplest way to achieve that. Alternatives considered: 1. Making the diff awareness modules stateful. However, I did not want to do so as I've also been working on improving the module API to reduce state, or at least to have a proper lifecycle management for any necessary state. 2. Making the watchFs flag a constructor parameter. However, that would also invalidate any implementations that don't use the flag (of which we have several). 3. Only passing in a single boolean flag instead of an options class provider; however, this is a more principled, futureproof API, which allows other modules / awareness implementations to use their own options. RELNOTES: --watchfs is now a command option; the startup option of the same name is deprecated. I.e., use bazel build --watchfs, not blaze --watchfs build. -- MOS_MIGRATED_REVID=136026835 --- .../java/com/google/devtools/build/lib/skyframe/DiffAwareness.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/DiffAwareness.java') diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/DiffAwareness.java b/src/main/java/com/google/devtools/build/lib/skyframe/DiffAwareness.java index f51cdfe281..64c90338d0 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/DiffAwareness.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/DiffAwareness.java @@ -15,9 +15,8 @@ package com.google.devtools.build.lib.skyframe; import com.google.devtools.build.lib.vfs.ModifiedFileSet; import com.google.devtools.build.lib.vfs.Path; - +import com.google.devtools.common.options.OptionsClassProvider; import java.io.Closeable; - import javax.annotation.Nullable; /** @@ -55,7 +54,7 @@ public interface DiffAwareness extends Closeable { * {@link DiffAwareness} instance. The {@link DiffAwareness} is expected to close itself in * this case. */ - View getCurrentView() throws BrokenDiffAwarenessException; + View getCurrentView(OptionsClassProvider options) throws BrokenDiffAwarenessException; /** * Returns the set of files of interest that have been modified between the given two views. -- cgit v1.2.3