diff --git a/src/com/facebook/buck/cli/AbstractCommandRunner.java b/src/com/facebook/buck/cli/AbstractCommandRunner.java index 23b9406345b..cdaefb38eef 100644 --- a/src/com/facebook/buck/cli/AbstractCommandRunner.java +++ b/src/com/facebook/buck/cli/AbstractCommandRunner.java @@ -126,7 +126,9 @@ protected ImmutableSet getBuildTargets( public ArtifactCache getArtifactCache(CommandRunnerParams params, T options) throws InterruptedException { - return params.getArtifactCacheFactory().newInstance(params.getBuckConfig(), options); + return params + .getArtifactCacheFactory() + .newInstance(params.getBuckConfig(), options.isNoCache()); } private static class ParserAndOptions { diff --git a/src/com/facebook/buck/cli/ArtifactCacheFactory.java b/src/com/facebook/buck/cli/ArtifactCacheFactory.java index 2ac3e6cd697..c281897e139 100644 --- a/src/com/facebook/buck/cli/ArtifactCacheFactory.java +++ b/src/com/facebook/buck/cli/ArtifactCacheFactory.java @@ -25,7 +25,7 @@ */ public interface ArtifactCacheFactory { - public ArtifactCache newInstance(BuckConfig buckConfig, AbstractCommandOptions options) + public ArtifactCache newInstance(BuckConfig buckConfig, boolean noop) throws InterruptedException; /** diff --git a/src/com/facebook/buck/cli/LoggingArtifactCacheFactory.java b/src/com/facebook/buck/cli/LoggingArtifactCacheFactory.java index 602ffcc4009..688236f1594 100644 --- a/src/com/facebook/buck/cli/LoggingArtifactCacheFactory.java +++ b/src/com/facebook/buck/cli/LoggingArtifactCacheFactory.java @@ -54,9 +54,9 @@ public LoggingArtifactCacheFactory( } @Override - public ArtifactCache newInstance(BuckConfig buckConfig, AbstractCommandOptions options) + public ArtifactCache newInstance(BuckConfig buckConfig, boolean noop) throws InterruptedException { - if (options.isNoCache()) { + if (noop) { return new NoopArtifactCache(); } else { buckEventBus.post(ArtifactCacheConnectEvent.started()); diff --git a/test/com/facebook/buck/cli/InstanceArtifactCacheFactory.java b/test/com/facebook/buck/cli/InstanceArtifactCacheFactory.java index 6eef8887b55..51597f585bd 100644 --- a/test/com/facebook/buck/cli/InstanceArtifactCacheFactory.java +++ b/test/com/facebook/buck/cli/InstanceArtifactCacheFactory.java @@ -24,7 +24,7 @@ /** * An implementation of {@link ArtifactCacheFactory} used for testing that always returns the * instance of {@link ArtifactCache} passed to its constructor when its - * {@link #newInstance(BuckConfig, AbstractCommandOptions)} method is invoked. + * {@link #newInstance(BuckConfig, boolean)} method is invoked. */ public class InstanceArtifactCacheFactory implements ArtifactCacheFactory { @@ -35,7 +35,7 @@ public InstanceArtifactCacheFactory(ArtifactCache artifactCache) { } @Override - public ArtifactCache newInstance(BuckConfig buckConfig, AbstractCommandOptions options) { + public ArtifactCache newInstance(BuckConfig buckConfig, boolean noop) { return artifactCache; }