diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BUILD b/src/main/java/com/google/devtools/build/lib/analysis/BUILD index e8832fd32de22a..a04dad6e485b28 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BUILD +++ b/src/main/java/com/google/devtools/build/lib/analysis/BUILD @@ -121,7 +121,6 @@ java_library( ":test/analysis_failure", ":test/analysis_failure_info", ":test/analysis_test_result_info", - ":test/baseline_coverage_result", ":test/coverage_report_action_factory", ":test/execution_info", ":test/instrumented_files_info", @@ -343,7 +342,6 @@ java_library( ":test/analysis_failure_info", ":test/analysis_failure_propagation_exception", ":test/analysis_test_result_info", - ":test/baseline_coverage_result", ":test/coverage_configuration", ":test/execution_info", ":test/instrumented_files_info", @@ -2737,16 +2735,6 @@ java_library( ], ) -java_library( - name = "test/baseline_coverage_result", - srcs = ["test/BaselineCoverageResult.java"], - deps = [ - "//src/main/java/com/google/devtools/build/lib/actions:artifacts", - "//src/main/java/com/google/devtools/build/lib/events", - "//third_party:guava", - ], -) - java_library( name = "test/coverage_configuration", srcs = ["test/CoverageConfiguration.java"], diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageAction.java b/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageAction.java index b702132ffd4f74..edff573b51f4c1 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageAction.java @@ -21,16 +21,13 @@ import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.ArtifactExpander; import com.google.devtools.build.lib.actions.Artifacts; -import com.google.devtools.build.lib.actions.NotifyOnActionCacheHit; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.actions.AbstractFileWriteAction; import com.google.devtools.build.lib.analysis.actions.DeterministicWriter; -import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.collect.nestedset.Order; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; -import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.vfs.PathFragment; import java.io.PrintWriter; @@ -39,8 +36,7 @@ /** Generates baseline (empty) coverage for the given non-test target. */ @VisibleForTesting @Immutable -public final class BaselineCoverageAction extends AbstractFileWriteAction - implements NotifyOnActionCacheHit { +public final class BaselineCoverageAction extends AbstractFileWriteAction { private final NestedSet instrumentedFiles; private BaselineCoverageAction( @@ -76,24 +72,6 @@ public DeterministicWriter newDeterministicWriter(ActionExecutionContext ctx) { }; } - @Override - protected void afterWrite(ActionExecutionContext actionExecutionContext) { - notifyAboutBaselineCoverage(actionExecutionContext.getEventHandler()); - } - - @Override - public boolean actionCacheHit(ActionCachedContext context) { - notifyAboutBaselineCoverage(context.getEventHandler()); - return true; - } - - /** Notifies interested parties about new baseline coverage data. */ - private void notifyAboutBaselineCoverage(ExtendedEventHandler eventHandler) { - Artifact output = getPrimaryOutput(); - String ownerString = Label.print(getOwner().getLabel()); - eventHandler.post(new BaselineCoverageResult(output, ownerString)); - } - static BaselineCoverageAction create( RuleContext ruleContext, NestedSet instrumentedFiles) { // Baseline coverage artifacts will still go into "testlogs" directory. diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageResult.java b/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageResult.java deleted file mode 100644 index c18f37c923b53e..00000000000000 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageResult.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.analysis.test; - -import com.google.common.base.Preconditions; -import com.google.devtools.build.lib.actions.Artifact; -import com.google.devtools.build.lib.events.ExtendedEventHandler; - -/** This event is used to notify about a successfully built baseline coverage artifact. */ -public final class BaselineCoverageResult implements ExtendedEventHandler.Postable { - - private final Artifact baselineCoverageData; - private final String ownerString; - - BaselineCoverageResult(Artifact baselineCoverageData, String ownerString) { - this.baselineCoverageData = Preconditions.checkNotNull(baselineCoverageData); - this.ownerString = Preconditions.checkNotNull(ownerString); - } - - public Artifact getArtifact() { - return baselineCoverageData; - } - - public String getOwnerString() { - return ownerString; - } -}