diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/BuildView.java | 63 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | 30 |
2 files changed, 64 insertions, 29 deletions
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 c788f56861..ce726dcbed 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 @@ -954,22 +954,59 @@ public class BuildView { // For testing @VisibleForTesting - public Iterable<ConfiguredTarget> getDirectPrerequisitesForTesting( - ExtendedEventHandler eventHandler, ConfiguredTarget ct, + public Collection<ConfiguredTarget> getDirectPrerequisitesForTesting( + ExtendedEventHandler eventHandler, + ConfiguredTarget ct, BuildConfigurationCollection configurations) - throws EvalException, InvalidConfigurationException, - InterruptedException, InconsistentAspectOrderException { + throws EvalException, InvalidConfigurationException, InterruptedException, + InconsistentAspectOrderException { return Collections2.transform( - skyframeExecutor.getConfiguredTargetsForTesting( - eventHandler, - ct.getConfiguration(), - ImmutableSet.copyOf( - getDirectPrerequisiteDependenciesForTesting( - eventHandler, ct, configurations, /*toolchainContext=*/ null) - .values())), + getConfiguredTargetAndDataDirectPrerequisitesForTesting(eventHandler, ct, configurations), ConfiguredTargetAndData::getConfiguredTarget); } + // TODO(janakr): pass the configuration in as a parameter here and above. + @VisibleForTesting + public Collection<ConfiguredTargetAndData> + getConfiguredTargetAndDataDirectPrerequisitesForTesting( + ExtendedEventHandler eventHandler, + ConfiguredTarget ct, + BuildConfigurationCollection configurations) + throws EvalException, InvalidConfigurationException, InterruptedException, + InconsistentAspectOrderException { + return getConfiguredTargetAndDataDirectPrerequisitesForTesting( + eventHandler, ct, ct.getConfiguration(), configurations); + } + + @VisibleForTesting + public Collection<ConfiguredTargetAndData> + getConfiguredTargetAndDataDirectPrerequisitesForTesting( + ExtendedEventHandler eventHandler, + ConfiguredTargetAndData ct, + BuildConfigurationCollection configurations) + throws EvalException, InvalidConfigurationException, InterruptedException, + InconsistentAspectOrderException { + return getConfiguredTargetAndDataDirectPrerequisitesForTesting( + eventHandler, ct.getConfiguredTarget(), ct.getConfiguration(), configurations); + } + + private Collection<ConfiguredTargetAndData> + getConfiguredTargetAndDataDirectPrerequisitesForTesting( + ExtendedEventHandler eventHandler, + ConfiguredTarget ct, + BuildConfiguration configuration, + BuildConfigurationCollection configurations) + throws EvalException, InvalidConfigurationException, InterruptedException, + InconsistentAspectOrderException { + return skyframeExecutor.getConfiguredTargetsForTesting( + eventHandler, + configuration, + ImmutableSet.copyOf( + getDirectPrerequisiteDependenciesForTesting( + eventHandler, ct, configurations, /*toolchainContext=*/ null) + .values())); + } + @VisibleForTesting public OrderedSetMultimap<Attribute, Dependency> getDirectPrerequisiteDependenciesForTesting( final ExtendedEventHandler eventHandler, @@ -1146,9 +1183,9 @@ public class BuildView { } @VisibleForTesting - public ConfiguredTargetAndData getConfiguredTargetAndTargetForTesting( + public ConfiguredTargetAndData getConfiguredTargetAndDataForTesting( ExtendedEventHandler eventHandler, Label label, BuildConfiguration config) { - return skyframeExecutor.getConfiguredTargetAndTargetForTesting(eventHandler, label, config); + return skyframeExecutor.getConfiguredTargetAndDataForTesting(eventHandler, label, config); } /** diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index 8783f43d5f..d5c54471a3 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -1665,36 +1665,34 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { BuildConfiguration configuration, ConfigurationTransition transition) { ConfiguredTargetAndData configuredTargetAndData = - getConfiguredTargetAndTargetForTesting(eventHandler, label, configuration, transition); + getConfiguredTargetAndDataForTesting(eventHandler, label, configuration, transition); return configuredTargetAndData == null ? null : configuredTargetAndData.getConfiguredTarget(); } @VisibleForTesting @Nullable - public ConfiguredTargetAndData getConfiguredTargetAndTargetForTesting( + public ConfiguredTargetAndData getConfiguredTargetAndDataForTesting( ExtendedEventHandler eventHandler, Label label, BuildConfiguration configuration, ConfigurationTransition transition) { - ConfiguredTargetAndData configuredTargetAndData = - Iterables.getFirst( - getConfiguredTargetsForTesting( - eventHandler, - configuration, - ImmutableList.of( - configuration == null - ? Dependency.withNullConfiguration(label) - : Dependency.withTransitionAndAspects( - label, transition, AspectCollection.EMPTY))), - null); - return configuredTargetAndData; + return Iterables.getFirst( + getConfiguredTargetsForTesting( + eventHandler, + configuration, + ImmutableList.of( + configuration == null + ? Dependency.withNullConfiguration(label) + : Dependency.withTransitionAndAspects( + label, transition, AspectCollection.EMPTY))), + null); } @VisibleForTesting @Nullable - public ConfiguredTargetAndData getConfiguredTargetAndTargetForTesting( + public ConfiguredTargetAndData getConfiguredTargetAndDataForTesting( ExtendedEventHandler eventHandler, Label label, BuildConfiguration configuration) { - return getConfiguredTargetAndTargetForTesting( + return getConfiguredTargetAndDataForTesting( eventHandler, label, configuration, NoTransition.INSTANCE); } |