Java Code Examples for org.gradle.api.tasks.TaskState#getFailure()

The following examples show how to use org.gradle.api.tasks.TaskState#getFailure() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MeasuringTaskExecutionListener.java    From firebase-android-sdk with Apache License 2.0 5 votes vote down vote up
@Override
public void afterExecute(Task task, TaskState taskState) {
  recordElapsed(task);
  long elapsedTime = getTotalElapsed(task);

  if (taskState.getFailure() != null) {
    metrics.measureFailure(task);
    return;
  }
  metrics.measureSuccess(task, elapsedTime);
}
 
Example 2
Source File: GradleBuildMetricsCollector.java    From gradle-metrics-plugin with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
Result getTaskExecutionResult(TaskExecution taskExecution) {
    Result result = Result.success();
    TaskState state = taskExecution.getState();
    if (state == null || !state.getDidWork()) {
        result = Result.skipped();
    } else {
        //noinspection ThrowableResultOfMethodCallIgnored
        Throwable failure = state.getFailure();
        if (failure != null) {
            result = Result.failure(failure);
        }
    }
    return result;
}
 
Example 3
Source File: TaskExecutionLogger.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
 
Example 4
Source File: TaskExecutionLogger.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
 
Example 5
Source File: TaskExecutionLogger.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
 
Example 6
Source File: TaskExecutionLogger.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}