Package org.gradle.api.internal.changedetection

Examples of org.gradle.api.internal.changedetection.TaskArtifactState


        this.repository = repository;
    }

    public void execute(TaskInternal task, TaskStateInternal state) {
        LOGGER.debug("Determining if {} is up-to-date", task);
        TaskArtifactState taskArtifactState = repository.getStateFor(task);
        if (taskArtifactState.isUpToDate()) {
            LOGGER.debug("{} is up-to-date", task);
            state.upToDate();
            return;

        }
        LOGGER.debug("{} is not up-to-date", task);

        task.getOutputs().setHistory(taskArtifactState);
        try {
            executer.execute(task, state);
            if (state.getFailure() == null) {
                taskArtifactState.update();
            }
        } finally {
            task.getOutputs().setHistory(null);
        }
    }
View Full Code Here


    }

    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();
        }
    }
View Full Code Here

        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'.");
        }
View Full Code Here

TOP

Related Classes of org.gradle.api.internal.changedetection.TaskArtifactState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.