aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-03-26 09:26:53 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-26 09:28:16 -0700
commit171a7ebd9a28c4169f2c3018b9c4d740dadcf324 (patch)
tree6c97755630f7bce831ae7cc8a5fe0f0c9ee6cf1a /src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
parent8688b68d4331449f97b04a868c0d61c62eff71f2 (diff)
Deprecate TransitiveInfoCollection#getConfiguration(), adding two new methods, TransitiveInfoCollection#getConfigurationKey() and ConfiguredTarget#getConfigurationChecksum(). These methods currently delegate to #getConfiguration(), but in the future they won't. I hope to get rid of #getConfigurationChecksum(), but I may have to fold the checksum into BuildConfigurationValue.Key or leave it as a separate field in ConfiguredTarget.
Transform a representative (random?) selection of #getConfiguration calls, to show that it's pretty much possible everywhere. PiperOrigin-RevId: 190474978
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
index e5692d3376..657eeee232 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java
@@ -43,13 +43,19 @@ public class ConfiguredTargetKey extends ActionLookupKey {
this.configurationKey = configurationKey;
}
+ /** Use {@link #of(ConfiguredTarget, BuildConfiguration)} instead of this. */
+ @Deprecated
public static ConfiguredTargetKey of(ConfiguredTarget configuredTarget) {
+ return of(configuredTarget, configuredTarget.getConfiguration());
+ }
+
+ public static ConfiguredTargetKey of(
+ ConfiguredTarget configuredTarget, BuildConfiguration buildConfiguration) {
AliasProvider aliasProvider = configuredTarget.getProvider(AliasProvider.class);
Label label =
aliasProvider != null ? aliasProvider.getAliasChain().get(0) : configuredTarget.getLabel();
- return of(label, configuredTarget.getConfiguration());
+ return of(label, buildConfiguration);
}
-
/**
* Caches so that the number of ConfiguredTargetKey instances is {@code O(configured targets)} and
* not {@code O(edges between configured targets)}.