Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Use BuildAdapter to prevent buildStarted usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Oct 3, 2019
1 parent 7ead748 commit acb7f3c
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import nebula.plugin.metrics.model.TaskExecution;
import nebula.plugin.metrics.time.BuildStartedTime;
import nebula.plugin.metrics.time.Clock;
import org.gradle.BuildListener;
import org.gradle.BuildAdapter;
import org.gradle.BuildResult;
import org.gradle.StartParameter;
import org.gradle.api.Plugin;
Expand All @@ -46,7 +46,6 @@
import org.gradle.api.initialization.Settings;
import org.gradle.api.invocation.Gradle;
import org.gradle.api.tasks.TaskState;
import org.gradle.util.DeprecationLogger;
import org.joda.time.DateTime;
import org.slf4j.Logger;

Expand All @@ -59,7 +58,7 @@
import static com.google.common.base.Preconditions.checkState;
import static org.apache.commons.lang3.exception.ExceptionUtils.getRootCauseMessage;

public final class GradleBuildMetricsCollector implements BuildListener, ProjectEvaluationListener, TaskExecutionListener, DependencyResolutionListener {
public final class GradleBuildMetricsCollector extends BuildAdapter implements ProjectEvaluationListener, TaskExecutionListener, DependencyResolutionListener {

private static final long TIMEOUT_MS = 5000;

Expand All @@ -83,15 +82,6 @@ public GradleBuildMetricsCollector(Supplier<MetricsDispatcher> dispatcherSupplie
private final Clock clock;
private BuildMetrics buildMetrics;

/**
* This is just to keep in sync with the interface
* @param gradle
*/
@Override
public void buildStarted(Gradle gradle) {
//Remove warning as this does nothing
DeprecationLogger.whileDisabled(() -> checkNotNull(gradle));
}

@Override
public void settingsEvaluated(Settings settings) {
Expand Down

0 comments on commit acb7f3c

Please sign in to comment.