org.gradle.api.tasks.TaskState Java Examples

The following examples show how to use org.gradle.api.tasks.TaskState. 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: InProcessGradleExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
 
Example #2
Source File: InProcessGradleExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
 
Example #3
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 #4
Source File: GradleBuildMetricsCollector.java    From gradle-metrics-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void afterExecute(Task task, TaskState state) {
    initializeBuildMetrics();
    long now = clock.getCurrentTime();
    Project project = task.getProject();
    ProjectMetrics projectMetrics = buildMetrics.getProjectProfile(project.getPath());
    TaskExecution taskExecution = projectMetrics.getTaskProfile(task.getPath());
    taskExecution.setFinish(now);
    taskExecution.completed(state);
}
 
Example #5
Source File: ProfileEventAdapter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    long now = timeProvider.getCurrentTime();
    Project project = task.getProject();
    ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
    TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath());
    taskExecution.setFinish(now);
    taskExecution.completed(state);
}
 
Example #6
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 #7
Source File: ProfileEventAdapter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    long now = timeProvider.getCurrentTime();
    Project project = task.getProject();
    ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
    TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath());
    taskExecution.setFinish(now);
    taskExecution.completed(state);
}
 
Example #8
Source File: InProcessGradleExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
 
Example #9
Source File: ProfileEventAdapter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    long now = timeProvider.getCurrentTime();
    Project project = task.getProject();
    ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
    TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath());
    taskExecution.setFinish(now);
    taskExecution.completed(state);
}
 
Example #10
Source File: ProfileEventAdapter.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    long now = timeProvider.getCurrentTime();
    Project project = task.getProject();
    ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
    TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath());
    taskExecution.setFinish(now);
    taskExecution.completed(state);
}
 
Example #11
Source File: InProcessGradleExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
 
Example #12
Source File: AbstractTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskState getState() {
    return state;
}
 
Example #13
Source File: TaskExecution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskState getState() {
    return state;
}
 
Example #14
Source File: TaskExecution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
 
Example #15
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 #16
Source File: BuildProgressFilter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
 
Example #17
Source File: ExecuteGradleCommandClientProtocol.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    totalTasksExecuted++;
    percentComplete = (totalTasksExecuted / totalTasksToExecute) * 100;
    String currentTaskName = task.getProject().getName() + ":" + task.getName();
    client.sendMessage(ProtocolConstants.TASK_COMPLETE_TYPE, currentTaskName, new Float(percentComplete));
}
 
Example #18
Source File: ExecuteGradleCommandClientProtocol.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    totalTasksExecuted++;
    percentComplete = (totalTasksExecuted / totalTasksToExecute) * 100;
    String currentTaskName = task.getProject().getName() + ":" + task.getName();
    client.sendMessage(ProtocolConstants.TASK_COMPLETE_TYPE, currentTaskName, new Float(percentComplete));
}
 
Example #19
Source File: TaskExecution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskState getState() {
    return state;
}
 
Example #20
Source File: TaskExecution.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
 
Example #21
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 #22
Source File: BuildProgressFilter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
 
Example #23
Source File: TaskExecution.java    From gradle-metrics-plugin with Apache License 2.0 4 votes vote down vote up
public TaskState getState() {
    return state;
}
 
Example #24
Source File: TaskExecution.java    From gradle-metrics-plugin with Apache License 2.0 4 votes vote down vote up
public TaskExecution completed(TaskState state) {
    checkNotNull(state);
    this.state = state;
    return this;
}
 
Example #25
Source File: ExecuteGradleCommandClientProtocol.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    totalTasksExecuted++;
    percentComplete = (totalTasksExecuted / totalTasksToExecute) * 100;
    String currentTaskName = task.getProject().getName() + ":" + task.getName();
    client.sendMessage(ProtocolConstants.TASK_COMPLETE_TYPE, currentTaskName, new Float(percentComplete));
}
 
Example #26
Source File: BuildProgressFilter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
 
Example #27
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 #28
Source File: TaskExecution.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
 
Example #29
Source File: TaskExecution.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskState getState() {
    return state;
}
 
Example #30
Source File: AbstractTask.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public TaskState getState() {
    return state;
}