Java 类org.gradle.api.internal.changedetection.TaskArtifactState 实例源码

项目:Reer    文件:ShortCircuitTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {

        if (!task.getOutputs().getHasOutput()) { // Only false if no declared outputs AND no Task.upToDateWhen spec. We force to true for incremental tasks.
            return new NoHistoryArtifactState();
        }

        final TaskArtifactState state = repository.getStateFor(task);

        if (startParameter.isRerunTasks()) {
            return new RerunTaskArtifactState(state, task, "Executed with '--rerun-tasks'.");
        }

        if (!task.getOutputs().getUpToDateSpec().isSatisfiedBy(task)) {
            return new RerunTaskArtifactState(state, task, "Task.upToDateWhen is false.");
        }

        return state;
    }
项目:Pushjet-Android    文件:ShortCircuitTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {

        if (!task.getOutputs().getHasOutput()) { // Only false if no declared outputs AND no Task.upToDateWhen spec. We force to true for incremental tasks.
            return new NoHistoryArtifactState();
        }

        final TaskArtifactState state = repository.getStateFor(task);

        if (startParameter.isRerunTasks()) {
            return new RerunTaskArtifactState(state, task, "Executed with '--rerun-tasks'.");
        }

        if (!task.getOutputs().getUpToDateSpec().isSatisfiedBy(task)) {
            return new RerunTaskArtifactState(state, task, "Task.upToDateWhen is false.");
        }

        return state;
    }
项目:Pushjet-Android    文件:ShortCircuitTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {

        if (!task.getOutputs().getHasOutput()) { // Only false if no declared outputs AND no Task.upToDateWhen spec. We force to true for incremental tasks.
            return new NoHistoryArtifactState();
        }

        final TaskArtifactState state = repository.getStateFor(task);

        if (startParameter.isRerunTasks()) {
            return new RerunTaskArtifactState(state, task, "Executed with '--rerun-tasks'.");
        }

        if (!task.getOutputs().getUpToDateSpec().isSatisfiedBy(task)) {
            return new RerunTaskArtifactState(state, task, "Task.upToDateWhen is false.");
        }

        return state;
    }
项目:Reer    文件:SkipUpToDateTaskExecuter.java   
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    LOGGER.debug("Determining if {} is up-to-date", task);
    Timer clock = Timers.startTimer();
    TaskArtifactState taskArtifactState = context.getTaskArtifactState();
    try {
        List<String> messages = LOGGER.isInfoEnabled() ? new ArrayList<String>() : null;
        if (taskArtifactState.isUpToDate(messages)) {
            LOGGER.info("Skipping {} as it is up-to-date (took {}).", task, clock.getElapsed());
            state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
            return;
        }
        logOutOfDateMessages(messages, task, clock.getElapsed());

        task.getOutputs().setHistory(taskArtifactState.getExecutionHistory());

        taskArtifactState.beforeTask();
        try {
            executer.execute(task, state, context);
            if (state.getFailure() == null) {
                taskArtifactState.afterTask();
            }
        } finally {
            task.getOutputs().setHistory(null);
        }
    } finally {
        taskArtifactState.finished();
    }
}
项目:Pushjet-Android    文件:SkipUpToDateTaskExecuter.java   
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    LOGGER.debug("Determining if {} is up-to-date", task);
    Clock clock = new Clock();
    TaskArtifactState taskArtifactState = repository.getStateFor(task);
    try {
        List<String> messages = new ArrayList<String>();
        if (taskArtifactState.isUpToDate(messages)) {
            LOGGER.info("Skipping {} as it is up-to-date (took {}).", task, clock.getTime());
            state.upToDate();
            return;
        }
        logOutOfDateMessages(messages, task, clock.getTime());

        task.getOutputs().setHistory(taskArtifactState.getExecutionHistory());
        context.setTaskArtifactState(taskArtifactState);

        taskArtifactState.beforeTask();
        try {
            executer.execute(task, state, context);
            if (state.getFailure() == null) {
                taskArtifactState.afterTask();
            }
        } finally {
            task.getOutputs().setHistory(null);
            context.setTaskArtifactState(null);
        }
    } finally {
        taskArtifactState.finished();
    }
}
项目:Pushjet-Android    文件:SkipUpToDateTaskExecuter.java   
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    LOGGER.debug("Determining if {} is up-to-date", task);
    Clock clock = new Clock();
    TaskArtifactState taskArtifactState = repository.getStateFor(task);
    try {
        List<String> messages = new ArrayList<String>();
        if (taskArtifactState.isUpToDate(messages)) {
            LOGGER.info("Skipping {} as it is up-to-date (took {}).", task, clock.getTime());
            state.upToDate();
            return;
        }
        logOutOfDateMessages(messages, task, clock.getTime());

        task.getOutputs().setHistory(taskArtifactState.getExecutionHistory());
        context.setTaskArtifactState(taskArtifactState);

        taskArtifactState.beforeTask();
        try {
            executer.execute(task, state, context);
            if (state.getFailure() == null) {
                taskArtifactState.afterTask();
            }
        } finally {
            task.getOutputs().setHistory(null);
            context.setTaskArtifactState(null);
        }
    } finally {
        taskArtifactState.finished();
    }
}
项目:CodeColors    文件:IgnoreResFilesTaskActionWrapper.java   
@Override
public void setTaskArtifactState(TaskArtifactState taskArtifactState) {
    if (taskArtifactState != null) {
        mTaskArtifactState = new IgnoreResFilesTaskArtifactStateWrapper(taskArtifactState, mResFiles);
    } else {
        mTaskArtifactState = null;
    }
}
项目:CodeColors    文件:IgnoreResFilesTaskActionWrapper.java   
public IgnoreResFilesTaskArtifactStateWrapper(TaskArtifactState taskArtifactState, Set<File> resFiles) {
    mTaskArtifactState = taskArtifactState;
    mIncrementalTaskInputs =
            new IgnoreResFilesIncrementalTaskInputsWrapper(taskArtifactState.getInputChanges(), resFiles);
    mTaskExecutionHistory =
            new IgnoreResFilesTaskExecutionHistoryWrapper(taskArtifactState.getExecutionHistory(), resFiles);
}
项目:Reer    文件:DefaultTaskExecutionContext.java   
public TaskArtifactState getTaskArtifactState() {
    return taskArtifactState;
}
项目:Reer    文件:DefaultTaskExecutionContext.java   
public void setTaskArtifactState(TaskArtifactState taskArtifactState) {
    this.taskArtifactState = taskArtifactState;
}
项目:Reer    文件:SkipEmptySourceFilesTaskExecuter.java   
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    FileCollection sourceFiles = task.getInputs().getSourceFiles();
    if (task.getInputs().getHasSourceFiles() && sourceFiles.isEmpty()) {
        TaskArtifactState taskArtifactState = context.getTaskArtifactState();
        FileCollection outputFiles = taskArtifactState.getExecutionHistory().getOutputFiles();
        if (outputFiles == null) {
            state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
            LOGGER.info("Skipping {} as it has no source files and no history of previous output files.", task);
        } else if (outputFiles.isEmpty()) {
            state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
            LOGGER.info("Skipping {} as it has no source files and no previous output files.", task);
        } else {
            Set<File> outputFileSet = outputFiles.getFiles();
            boolean deletedFiles = false;
            boolean debugEnabled = LOGGER.isDebugEnabled();
            for (File file : outputFileSet) {
                if (file.isFile()) {
                    if (file.delete()) {
                        if (debugEnabled) {
                            LOGGER.debug("Deleted stale output file '{}'.", file.getAbsolutePath());
                        }
                    } else {
                        state.setOutcome(new GradleException(String.format("Could not delete file: '%s'.", file.getAbsolutePath())));
                        return;
                    }
                    deletedFiles = true;
                }
            }
            if (deletedFiles) {
                LOGGER.info("Cleaned previous output of {} as it has no source files.", task);
                state.setOutcome(TaskExecutionOutcome.EXECUTED);
            } else {
                state.setOutcome(TaskExecutionOutcome.UP_TO_DATE);
            }
        }
        taskInputsListener.onExecute(task, Cast.cast(FileCollectionInternal.class, sourceFiles));
        return;
    } else {
        taskInputsListener.onExecute(task, Cast.cast(FileCollectionInternal.class, task.getInputs().getFiles()));
    }
    executer.execute(task, state, context);
}
项目:Reer    文件:DefaultTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {
    return new TaskArtifactStateImpl(task, taskHistoryRepository.getHistory(task));
}
项目:Reer    文件:ShortCircuitTaskArtifactStateRepository.java   
private RerunTaskArtifactState(TaskArtifactState delegate, TaskInternal task, String reason) {
    this.delegate = delegate;
    this.task = task;
    this.reason = reason;
}
项目:Pushjet-Android    文件:DefaultTaskExecutionContext.java   
public TaskArtifactState getTaskArtifactState() {
    return taskArtifactState;
}
项目:Pushjet-Android    文件:DefaultTaskExecutionContext.java   
public void setTaskArtifactState(TaskArtifactState taskArtifactState) {
    this.taskArtifactState = taskArtifactState;
}
项目:Pushjet-Android    文件:DefaultTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {
    return new TaskArtifactStateImpl(task, taskHistoryRepository.getHistory(task));
}
项目:Pushjet-Android    文件:ShortCircuitTaskArtifactStateRepository.java   
private RerunTaskArtifactState(TaskArtifactState delegate, TaskInternal task, String reason) {
    this.delegate = delegate;
    this.task = task;
    this.reason = reason;
}
项目:Pushjet-Android    文件:DefaultTaskExecutionContext.java   
public TaskArtifactState getTaskArtifactState() {
    return taskArtifactState;
}
项目:Pushjet-Android    文件:DefaultTaskExecutionContext.java   
public void setTaskArtifactState(TaskArtifactState taskArtifactState) {
    this.taskArtifactState = taskArtifactState;
}
项目:Pushjet-Android    文件:DefaultTaskArtifactStateRepository.java   
public TaskArtifactState getStateFor(final TaskInternal task) {
    return new TaskArtifactStateImpl(task, taskHistoryRepository.getHistory(task));
}
项目:Pushjet-Android    文件:ShortCircuitTaskArtifactStateRepository.java   
private RerunTaskArtifactState(TaskArtifactState delegate, TaskInternal task, String reason) {
    this.delegate = delegate;
    this.task = task;
    this.reason = reason;
}
项目:CodeColors    文件:IgnoreResFilesTaskActionWrapper.java   
@Override
public TaskArtifactState getTaskArtifactState() {
    return mTaskArtifactState;
}
项目:Reer    文件:TaskExecutionContext.java   
TaskArtifactState getTaskArtifactState();
项目:Reer    文件:TaskExecutionContext.java   
void setTaskArtifactState(TaskArtifactState taskArtifactState);
项目:Pushjet-Android    文件:TaskExecutionContext.java   
TaskArtifactState getTaskArtifactState();
项目:Pushjet-Android    文件:TaskExecutionContext.java   
void setTaskArtifactState(TaskArtifactState taskArtifactState);
项目:Pushjet-Android    文件:TaskExecutionContext.java   
TaskArtifactState getTaskArtifactState();
项目:Pushjet-Android    文件:TaskExecutionContext.java   
void setTaskArtifactState(TaskArtifactState taskArtifactState);