Search in sources :

Example 1 with ExecutionPhaseCompleteEvent

use of com.google.devtools.build.lib.buildtool.buildevent.ExecutionPhaseCompleteEvent in project bazel by bazelbuild.

the class ExecutionTool method determineSuccessfulTargets.

/**
   * Computes the result of the build. Sets the list of successful (up-to-date)
   * targets in the request object.
   *
   * @param configuredTargets The configured targets whose artifacts are to be
   *                          built.
   * @param timer A timer that was started when the execution phase started.
   */
private Collection<ConfiguredTarget> determineSuccessfulTargets(Collection<ConfiguredTarget> configuredTargets, Set<ConfiguredTarget> builtTargets, Stopwatch timer) {
    // Maintain the ordering by copying builtTargets into a LinkedHashSet in the same iteration
    // order as configuredTargets.
    Collection<ConfiguredTarget> successfulTargets = new LinkedHashSet<>();
    for (ConfiguredTarget target : configuredTargets) {
        if (builtTargets.contains(target)) {
            successfulTargets.add(target);
        }
    }
    env.getEventBus().post(new ExecutionPhaseCompleteEvent(timer.stop().elapsed(MILLISECONDS)));
    return successfulTargets;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ExecutionPhaseCompleteEvent(com.google.devtools.build.lib.buildtool.buildevent.ExecutionPhaseCompleteEvent) ConfiguredTarget(com.google.devtools.build.lib.analysis.ConfiguredTarget)

Aggregations

ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)1 ExecutionPhaseCompleteEvent (com.google.devtools.build.lib.buildtool.buildevent.ExecutionPhaseCompleteEvent)1 LinkedHashSet (java.util.LinkedHashSet)1