Adds a provider that exports Java source information. Adds some testing support for Aspects.
--
MOS_MIGRATED_REVID=93547419
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 8891b27..85c2664 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
@@ -931,6 +931,24 @@
}
/**
+ * For a configured target dependentTarget, returns the desired configured target
+ * that is depended upon. Useful for obtaining the a target with aspects
+ * required by the dependent.
+ */
+ @VisibleForTesting
+ public ConfiguredTarget getPrerequisiteConfiguredTargetForTesting(
+ ConfiguredTarget dependentTarget, ConfiguredTarget desiredTarget) {
+ Collection<ConfiguredTarget> configuredTargets =
+ getPrerequisiteMapForTesting(dependentTarget).values();
+ for (ConfiguredTarget ct : configuredTargets) {
+ if (ct.getLabel().equals(desiredTarget.getLabel())) {
+ return ct;
+ }
+ }
+ return null;
+ }
+
+ /**
* Tests and clears the current thread's pending "interrupted" status, and
* throws InterruptedException iff it was set.
*/