Java 类org.gradle.api.tasks.TaskState 实例源码

项目:gradle-circle-style    文件:CircleBuildFailureListener.java   
@Override
public synchronized void afterExecute(Task task, TaskState state) {
    if (isUntracked(task)) {
        Report.TestCase.Builder testCase = new Report.TestCase.Builder()
                .name(":" + task.getProject().getName() + ":" + task.getName());

        Throwable failure = state.getFailure();
        if (failure != null && isUntracked(task)) {
            if (failure instanceof TaskExecutionException && failure.getCause() != null) {
                failure = failure.getCause();
            }
            StringWriter stackTrace = new StringWriter();
            failure.printStackTrace(new PrintWriter(stackTrace));

            testCase.failure(new Report.Failure.Builder()
                    .message(getMessage(failure))
                    .details(stackTrace.toString())
                    .build());
        }
        testCases.add(testCase.build());
    }
}
项目:Reer    文件:AnnouncingBuildListener.java   
@Override
public void afterExecute(Task task, TaskState state) {
    if (state.getFailure() != null) {
        lastFailed = task;
        failed.add(task);
    }
}
项目:Reer    文件:InProcessGradleExecuter.java   
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
项目:Reer    文件:TaskExecutionStatisticsEventAdapter.java   
@Override
public void afterExecute(Task task, TaskState state) {
    TaskStateInternal stateInternal = (TaskStateInternal) state;
    TaskExecutionOutcome outcome = stateInternal.getOutcome();
    taskCounts.put(outcome, taskCounts.get(outcome) + 1);
    if (stateInternal.isCacheable() && outcome == TaskExecutionOutcome.EXECUTED) {
        cacheMissCount++;
    }
}
项目:Reer    文件:ProfileEventAdapter.java   
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);
}
项目:Reer    文件:DefaultTaskGraphExecuter.java   
public void afterTask(final Action<Task> action) {
    taskListeners.add(new TaskExecutionAdapter() {
        @Override
        public void afterExecute(Task task, TaskState state) {
            action.execute(task);
        }
    });
}
项目:Pushjet-Android    文件:InProcessGradleExecuter.java   
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
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);
}
项目:Pushjet-Android    文件:InProcessGradleExecuter.java   
public void afterExecute(Task task, TaskState state) {
    String taskPath = path(task);
    if (taskPath.startsWith(":buildSrc:")) {
        return;
    }

    if (state.getSkipped()) {
        skippedTasks.add(taskPath);
    }
}
项目:Pushjet-Android    文件:ProfileEventAdapter.java   
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);
}
项目:gradle-metrics-plugin    文件:GradleCollector.java   
@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;
}
项目:gradle-circle-style    文件:StyleTaskTimer.java   
@Override
public void afterExecute(Task task, TaskState taskState) {
    if (isStyleTask(task)) {
        taskTimeNanosByTask.put(task, System.nanoTime() - lastStartTime);
    }
}
项目:gradle-circle-style    文件:CircleBuildFailureListenerTests.java   
private static TaskState succeeded() {
    TaskStateInternal state = new TaskStateInternal();
    state.setOutcome(TaskExecutionOutcome.EXECUTED);
    return state;
}
项目:gradle-circle-style    文件:CircleBuildFailureListenerTests.java   
private static TaskState failed(String message) {
    TaskStateInternal state = new TaskStateInternal();
    state.setOutcome(TaskExecutionOutcome.EXECUTED);
    state.setOutcome(new RuntimeException(message));
    return state;
}
项目:Reer    文件:ExecuteGradleCommandClientProtocol.java   
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));
}
项目:Reer    文件:TaskExecution.java   
public TaskState getState() {
    return state;
}
项目:Reer    文件:TaskExecution.java   
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
项目:Reer    文件:TaskExecutionLogger.java   
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
项目:Reer    文件:BuildProgressFilter.java   
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
项目:Pushjet-Android    文件:ExecuteGradleCommandClientProtocol.java   
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));
}
项目:Pushjet-Android    文件:TaskExecution.java   
public TaskState getState() {
    return state;
}
项目:Pushjet-Android    文件:TaskExecution.java   
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
项目:Pushjet-Android    文件:TaskExecutionLogger.java   
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
项目:Pushjet-Android    文件:BuildProgressFilter.java   
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
项目:Pushjet-Android    文件:ExecuteGradleCommandClientProtocol.java   
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));
}
项目:Pushjet-Android    文件:AbstractTask.java   
public TaskState getState() {
    return state;
}
项目:Pushjet-Android    文件:TaskExecution.java   
public TaskState getState() {
    return state;
}
项目:Pushjet-Android    文件:TaskExecution.java   
public TaskExecution completed(TaskState state) {
    this.state = state;
    return this;
}
项目:Pushjet-Android    文件:TaskExecutionLogger.java   
public void afterExecute(Task task, TaskState state) {
    ProgressLogger currentTask = currentTasks.remove(task);
    String taskMessage = state.getFailure() != null ? "FAILED" : state.getSkipMessage();
    currentTask.completed(taskMessage);
}
项目:Pushjet-Android    文件:BuildProgressFilter.java   
public void afterExecute(Task task, TaskState state) {
    if (task.getProject().getGradle() == gradle) {
        logger.afterExecute();
    }
}
项目:Reer    文件:Task.java   
/**
 * Returns the execution state of this task. This provides information about the execution of this task, such as
 * whether it has executed, been skipped, has failed, etc.
 *
 * @return The execution state of this task. Never returns null.
 */
TaskState getState();
项目:Reer    文件:TaskExecutionListener.java   
/**
 * This method is call immediately after a task has been executed. It is always called, regardless of whether the
 * task completed successfully, or failed with an exception.
 *
 * @param task The task which was executed. Never null.
 * @param state The task state. If the task failed with an exception, the exception is available in this
 * state. Never null.
 */
void afterExecute(Task task, TaskState state);
项目:Pushjet-Android    文件:Task.java   
/**
 * Returns the execution state of this task. This provides information about the execution of this task, such as
 * whether it has executed, been skipped, has failed, etc.
 *
 * @return The execution state of this task. Never returns null.
 */
TaskState getState();
项目:Pushjet-Android    文件:TaskExecutionListener.java   
/**
 * This method is call immediately after a task has been executed. It is always called, regardless of whether the
 * task completed successfully, or failed with an exception.
 *
 * @param task The task which was executed. Never null.
 * @param state The task state. If the task failed with an exception, the exception is available in this
 * state. Never null.
 */
void afterExecute(Task task, TaskState state);
项目:Pushjet-Android    文件:Task.java   
/**
 * Returns the execution state of this task. This provides information about the execution of this task, such as
 * whether it has executed, been skipped, has failed, etc.
 *
 * @return The execution state of this task. Never returns null.
 */
TaskState getState();
项目:Pushjet-Android    文件:TaskExecutionListener.java   
/**
 * This method is call immediately after a task has been executed. It is always called, regardless of whether the
 * task completed successfully, or failed with an exception.
 *
 * @param task The task which was executed. Never null.
 * @param state The task state. If the task failed with an exception, the exception is available in this
 * state. Never null.
 */
void afterExecute(Task task, TaskState state);
项目:Reer    文件:TaskExecutionAdapter.java   
public void afterExecute(Task task, TaskState state) {}
项目:Pushjet-Android    文件:TaskExecutionAdapter.java   
public void afterExecute(Task task, TaskState state) {}
项目:Pushjet-Android    文件:TaskExecutionAdapter.java   
public void afterExecute(Task task, TaskState state) {}