Split AspectKey subclasses out of AspectValue.
PiperOrigin-RevId: 306879050
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AspectResolver.java b/src/main/java/com/google/devtools/build/lib/analysis/AspectResolver.java
index 69919c8..1a71603 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/AspectResolver.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/AspectResolver.java
@@ -25,6 +25,8 @@
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.skyframe.AspectCreationException;
import com.google.devtools.build.lib.skyframe.AspectValue;
+import com.google.devtools.build.lib.skyframe.AspectValueKey;
+import com.google.devtools.build.lib.skyframe.AspectValueKey.AspectKey;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetAndData;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey;
import com.google.devtools.build.lib.util.OrderedSetMultimap;
@@ -145,21 +147,25 @@
return result;
}
- private static AspectValue.AspectKey buildAspectKey(AspectCollection.AspectDeps aspectDeps,
- HashMap<AspectDescriptor, SkyKey> result, Dependency dep) {
+ private static AspectKey buildAspectKey(
+ AspectCollection.AspectDeps aspectDeps,
+ HashMap<AspectDescriptor, SkyKey> result,
+ Dependency dep) {
if (result.containsKey(aspectDeps.getAspect())) {
- return (AspectValue.AspectKey) result.get(aspectDeps.getAspect()).argument();
+ return (AspectKey) result.get(aspectDeps.getAspect()).argument();
}
- ImmutableList.Builder<AspectValue.AspectKey> dependentAspects = ImmutableList.builder();
+ ImmutableList.Builder<AspectKey> dependentAspects = ImmutableList.builder();
for (AspectCollection.AspectDeps path : aspectDeps.getDependentAspects()) {
dependentAspects.add(buildAspectKey(path, result, dep));
}
- AspectValue.AspectKey aspectKey = AspectValue.createAspectKey(
- dep.getLabel(), dep.getConfiguration(),
- dependentAspects.build(),
- aspectDeps.getAspect(),
- dep.getAspectConfiguration(aspectDeps.getAspect()));
+ AspectKey aspectKey =
+ AspectValueKey.createAspectKey(
+ dep.getLabel(),
+ dep.getConfiguration(),
+ dependentAspects.build(),
+ aspectDeps.getAspect(),
+ dep.getAspectConfiguration(aspectDeps.getAspect()));
result.put(aspectKey.getAspectDescriptor(), aspectKey);
return aspectKey;
}
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
index d28875b..d6313b6 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
@@ -67,8 +67,8 @@
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.skyframe.AspectValue;
-import com.google.devtools.build.lib.skyframe.AspectValue.AspectKey;
-import com.google.devtools.build.lib.skyframe.AspectValue.AspectValueKey;
+import com.google.devtools.build.lib.skyframe.AspectValueKey;
+import com.google.devtools.build.lib.skyframe.AspectValueKey.AspectKey;
import com.google.devtools.build.lib.skyframe.BuildConfigurationValue;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey;
import com.google.devtools.build.lib.skyframe.CoverageReportValue;
@@ -343,7 +343,7 @@
aspectConfigurations.put(
Pair.of(targetSpec.getLabel(), aspect), targetSpec.getConfiguration());
aspectKeys.add(
- AspectValue.createSkylarkAspectKey(
+ AspectValueKey.createSkylarkAspectKey(
targetSpec.getLabel(),
// For invoking top-level aspects, use the top-level configuration for both the
// aspect and the base target while the top-level configuration is untrimmed.
@@ -368,12 +368,11 @@
BuildConfiguration configuration = targetSpec.getConfiguration();
aspectConfigurations.put(Pair.of(targetSpec.getLabel(), aspect), configuration);
aspectKeys.add(
- AspectValue.createAspectKey(
+ AspectValueKey.createAspectKey(
targetSpec.getLabel(),
configuration,
new AspectDescriptor(aspectFactoryClass, AspectParameters.EMPTY),
- configuration
- ));
+ configuration));
}
} else {
throw new ViewCreationFailedException("Aspect '" + aspect + "' is unknown");