Skip to content

Commit

Permalink
Internal change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 501001992
Change-Id: Ibbd99fe45cf845e49bc2cbd0449c0838046b7ebf
  • Loading branch information
joeleba authored and hvadehra committed Feb 14, 2023
1 parent 1a5963a commit d245ac0
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public Artifact getExecutable() {
private final CompletionContext completionContext;
private final ImmutableMap<String, ArtifactsInOutputGroup> outputs;
private final NestedSet<Artifact> baselineCoverageArtifacts;
private final Label aliasLabel;
// The label as appeared in the BUILD file.
private final Label originalLabel;
private final boolean isTest;
private final boolean announceTargetSummary;
@Nullable private final Long testTimeoutSeconds;
Expand All @@ -146,10 +147,10 @@ private TargetCompleteEvent(
this.executableTargetData = new ExecutableTargetData(targetAndData);
ImmutableList.Builder<BuildEventId> postedAfterBuilder = ImmutableList.builder();
this.label = targetAndData.getConfiguredTarget().getLabel();
this.aliasLabel = targetAndData.getConfiguredTarget().getOriginalLabel();
this.originalLabel = targetAndData.getConfiguredTarget().getOriginalLabel();
this.configuredTargetKey =
ConfiguredTargetKey.fromConfiguredTarget(targetAndData.getConfiguredTarget());
postedAfterBuilder.add(BuildEventIdUtil.targetConfigured(aliasLabel));
postedAfterBuilder.add(BuildEventIdUtil.targetConfigured(originalLabel));
DetailedExitCode mostImportantDetailedExitCode = null;
for (Cause cause : getRootCauses().toList()) {
mostImportantDetailedExitCode =
Expand Down Expand Up @@ -227,6 +228,15 @@ public Label getLabel() {
return label;
}

/**
* Returns the original label of the target.
*
* <p>See {@link ConfiguredTarget#getOriginalLabel()}.
*/
public Label getOriginalLabel() {
return originalLabel;
}

public ConfiguredTargetKey getConfiguredTargetKey() {
return configuredTargetKey;
}
Expand Down Expand Up @@ -260,7 +270,7 @@ public Iterable<Artifact> getLegacyFilteredImportantArtifacts() {

@Override
public BuildEventId getEventId() {
return BuildEventIdUtil.targetCompleted(aliasLabel, configEventId);
return BuildEventIdUtil.targetCompleted(originalLabel, configEventId);
}

@Override
Expand All @@ -281,7 +291,7 @@ public ImmutableList<BuildEventId> getChildrenEvents() {
childrenBuilder.add(BuildEventIdUtil.testSummary(label, configEventId));
}
if (announceTargetSummary) {
childrenBuilder.add(BuildEventIdUtil.targetSummary(aliasLabel, configEventId));
childrenBuilder.add(BuildEventIdUtil.targetSummary(originalLabel, configEventId));
}
return childrenBuilder.build();
}
Expand Down

0 comments on commit d245ac0

Please sign in to comment.