From d8a9344699da2f6258eafa22566c7e541ec09792 Mon Sep 17 00:00:00 2001 From: ulfjack Date: Fri, 22 Dec 2017 00:59:05 -0800 Subject: Move TargetCompleteEvent generation to the CompletionFunction This change breaks without https://github.com/bazelbuild/bazel/commit/a0ea569f7df19b8284846a52854e73747f7ec005; if that change is rolled back, this change has to be rolled back as well. It was previously in ExecutionProgressReceiver, and directly hooked into Skyframe. Now that we have a way to post event bus events directly from Sky functions, we should just do that. Also, this allows us to access artifact metdata, since the completion function has all the necessary artifacts as dependencies, which in turn can be used to improve the build event protocol implementation, where we want to post URLs to the CAS, which requires knowing the checksum. PiperOrigin-RevId: 179903333 --- .../devtools/build/lib/analysis/TargetCompleteEvent.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java index 4a6e8aaa71..c1e7805bf7 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java @@ -57,7 +57,7 @@ public final class TargetCompleteEvent BuildEventWithConfiguration { private final ConfiguredTarget target; private final NestedSet rootCauses; - private final Collection postedAfter; + private final ImmutableList postedAfter; private final Iterable outputs; private final NestedSet baselineCoverageArtifacts; private final boolean isTest; @@ -71,7 +71,7 @@ public final class TargetCompleteEvent this.rootCauses = (rootCauses == null) ? NestedSetBuilder.emptySet(Order.STABLE_ORDER) : rootCauses; - ImmutableList.Builder postedAfterBuilder = ImmutableList.builder(); + ImmutableList.Builder postedAfterBuilder = ImmutableList.builder(); for (Cause cause : getRootCauses()) { postedAfterBuilder.add(BuildEventId.fromCause(cause)); } @@ -94,13 +94,13 @@ public final class TargetCompleteEvent } /** Construct a successful target completion event. */ - public static TargetCompleteEvent createSuccessfulTarget( + public static TargetCompleteEvent successfulBuild( ConfiguredTarget ct, NestedSet outputs) { return new TargetCompleteEvent(ct, null, outputs, false); } /** Construct a successful target completion event for a target that will be tested. */ - public static TargetCompleteEvent createSuccessfulTestTarget(ConfiguredTarget ct) { + public static TargetCompleteEvent successfulBuildSchedulingTest(ConfiguredTarget ct) { return new TargetCompleteEvent(ct, null, ImmutableList.of(), true); } @@ -147,7 +147,7 @@ public final class TargetCompleteEvent @Override public Collection getChildrenEvents() { - ImmutableList.Builder childrenBuilder = ImmutableList.builder(); + ImmutableList.Builder childrenBuilder = ImmutableList.builder(); for (Cause cause : getRootCauses()) { childrenBuilder.add(BuildEventId.fromCause(cause)); } -- cgit v1.2.3