Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit dd3c778

Browse files
Sergey Tyurinfacebook-github-bot
Sergey Tyurin
authored andcommitted
Revert changes around classpath deps in AndroidBinary
Reviewed By: bobyangyf shipit-source-id: d140c6a9ce
1 parent a0a13a2 commit dd3c778

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/com/facebook/buck/android/AndroidBinary.java

+4-14
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import com.facebook.buck.util.RichStream;
5656
import com.google.common.annotations.VisibleForTesting;
5757
import com.google.common.base.Preconditions;
58-
import com.google.common.base.Suppliers;
5958
import com.google.common.collect.ImmutableList;
6059
import com.google.common.collect.ImmutableSet;
6160
import com.google.common.collect.ImmutableSortedSet;
@@ -65,7 +64,6 @@
6564
import java.util.Optional;
6665
import java.util.Set;
6766
import java.util.SortedSet;
68-
import java.util.function.Supplier;
6967
import java.util.stream.Stream;
7068

7169
/**
@@ -118,8 +116,6 @@ public class AndroidBinary extends AbstractBuildRule
118116

119117
private final BuildRuleParams buildRuleParams;
120118

121-
private final Supplier<ImmutableSet<BuildRule>> classpathDepsSupplier;
122-
123119
@AddToRuleKey private final AndroidBinaryBuildable buildable;
124120

125121
// TODO(cjhopman): What's the difference between shouldProguard and skipProguard?
@@ -233,17 +229,11 @@ public class AndroidBinary extends AbstractBuildRule
233229
true);
234230
this.exopackageInfo = exopackageInfo;
235231

236-
this.classpathDepsSupplier =
237-
Suppliers.memoize(
238-
() -> ruleFinder.filterBuildRuleInputs(enhancementResult.getClasspathEntriesToDex()));
239-
240232
params =
241-
new BuildRuleParams(
242-
ImmutableSortedSet::of,
233+
params.withExtraDeps(
243234
() ->
244235
BuildableSupport.deriveDeps(this, ruleFinder)
245-
.collect(ImmutableSortedSet.toImmutableSortedSet(Ordering.natural())),
246-
params.getTargetGraphOnlyDeps());
236+
.collect(ImmutableSortedSet.toImmutableSortedSet(Ordering.natural())));
247237
this.buildRuleParams = params;
248238
}
249239

@@ -365,8 +355,8 @@ public Keystore getKeystore() {
365355
return keystore;
366356
}
367357

368-
public ImmutableSet<BuildRule> getClasspathDeps() {
369-
return classpathDepsSupplier.get();
358+
public SortedSet<BuildRule> getClasspathDeps() {
359+
return getDeclaredDeps();
370360
}
371361

372362
@Override

test/com/facebook/buck/android/AndroidResourceLibraryDepIntegrationTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void testModifyingLibraryDependencyDoesNotCauseRebuilt() throws IOExcepti
6969
// Now verify that just the library and top-level binary got rebuilt.
7070
BuckBuildLog secondBuildLog = workspace.getBuildLog();
7171
secondBuildLog.assertTargetBuiltLocally(appTarget);
72-
secondBuildLog.assertTargetIsAbsent(resTarget);
72+
secondBuildLog.assertTargetHadMatchingRuleKey(resTarget);
7373
secondBuildLog.assertTargetBuiltLocally(libTarget);
7474
}
7575
}

0 commit comments

Comments
 (0)