aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android
diff options
context:
space:
mode:
authorGravatar Liam Miller-Cushon <cushon@google.com>2016-06-21 17:45:41 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-06-22 10:46:36 +0000
commit611e7cd47de47fd7cc7e08a260d6640803aafd9f (patch)
tree05f2677123db5342a891f2db70d9af8e2a123fb1 /src/main/java/com/google/devtools/build/lib/rules/android
parentb995b4d5cbcd50a2f39352607f8caffe6c82cba3 (diff)
Fix analysis performance regression caused by header compilation
When building --direct_dependency/--indirect_dependency args, use a set for the direct jars to avoid an O(n) contains check, and make the CustomMultiArgv class static to avoid a memory leak. Also avoid flattening the NestedSet of direct jars for as long as possible. -- MOS_MIGRATED_REVID=125468789
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
index 870cee733a..edc438dbb3 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
@@ -375,8 +375,9 @@ public class AndroidCommon {
ImmutableList.Builder<Artifact> jarsProducedForRuntime) throws InterruptedException {
compileResourceJar(javaSemantics, resourcesJar);
// Add the compiled resource jar to the classpath of the main compilation.
- attributes.addDirectJars(ImmutableList.of(resourceClassJar));
- attributes.addDirectCompileTimeClassPathEntries(ImmutableList.of(resourceClassJar));
+ NestedSet<Artifact> directJars = NestedSetBuilder.create(Order.STABLE_ORDER, resourceClassJar);
+ attributes.addDirectJars(directJars);
+ attributes.addCompileTimeClassPathEntries(directJars);
// Add the compiled resource jar to the classpath of consuming targets.
artifactsBuilder.addCompileTimeJar(resourceClassJar);
// Combined resource constants needs to come even before our own classes that may contain