Java 类org.gradle.api.execution.TaskExecutionGraph 实例源码

项目:Reer    文件:DefaultTaskGraphExecuter.java   
public void whenReady(final Action<TaskExecutionGraph> action) {
    graphListeners.add(new TaskExecutionGraphListener() {
        @Override
        public void graphPopulated(TaskExecutionGraph graph) {
            action.execute(graph);
        }
    });
}
项目:Reer    文件:SelectedTaskExecutionAction.java   
@Override
public void graphPopulated(TaskExecutionGraph graph) {
    Set<Project> seen = Sets.newHashSet();
    for (Task task : graph.getAllTasks()) {
        if (seen.add(task.getProject())) {
            ProjectInternal projectInternal = (ProjectInternal) task.getProject();
            projectInternal.bindAllModelRules();
        }
    }
}
项目:shipkit    文件:LazyConfiguration.java   
public void graphPopulated(TaskExecutionGraph graph) {
    for (Task key : actions.keySet()) {
        if (graph.hasTask(key)) {
            for (Runnable r : actions.get(key)) {
                //TODO add 'info' level logging explaining what happens. Similar to how we do it in DeferredConfiguration
                r.run();
            }
        }
    }
}
项目:intellij-ce-playground    文件:TaskManager.java   
private void createLintVitalTask(@NonNull ApkVariantData variantData) {
    checkState(getExtension().getLintOptions().isCheckReleaseBuilds());
    // TODO: re-enable with Jack when possible
    if (!variantData.getVariantConfiguration().getBuildType().isDebuggable() &&
            !variantData.getVariantConfiguration().getUseJack()) {
        String variantName = variantData.getVariantConfiguration().getFullName();
        String capitalizedVariantName = StringHelper.capitalize(variantName);
        String taskName = "lintVital" + capitalizedVariantName;
        final Lint lintReleaseCheck = project.getTasks().create(taskName, Lint.class);
        // TODO: Make this task depend on lintCompile too (resolve initialization order first)
        optionalDependsOn(lintReleaseCheck, variantData.javacTask);
        lintReleaseCheck.setLintOptions(getExtension().getLintOptions());
        lintReleaseCheck.setSdkHome(sdkHandler.getSdkFolder());
        lintReleaseCheck.setVariantName(variantName);
        lintReleaseCheck.setToolingRegistry(toolingRegistry);
        lintReleaseCheck.setFatalOnly(true);
        lintReleaseCheck.setDescription(
                "Runs lint on just the fatal issues in the " + capitalizedVariantName
                        + " build.");
        //variantData.assembleVariantTask.dependsOn lintReleaseCheck

        // If lint is being run, we do not need to run lint vital.
        // TODO: Find a better way to do this.
        project.getGradle().getTaskGraph().whenReady(new Closure<Void>(this, this) {
            public void doCall(TaskExecutionGraph taskGraph) {
                if (taskGraph.hasTask(LINT)) {
                    lintReleaseCheck.setEnabled(false);
                }
            }
        });
    }
}
项目:Reer    文件:InProcessGradleExecuter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    List<Task> planned = new ArrayList<Task>(graph.getAllTasks());
    graph.addTaskExecutionListener(new TaskListenerImpl(planned, executedTasks, skippedTasks));
}
项目:Reer    文件:ExecuteGradleCommandClientProtocol.java   
public void graphPopulated(TaskExecutionGraph taskExecutionGraph) {
    List<Task> taskList = taskExecutionGraph.getAllTasks();

    this.totalTasksToExecute = taskList.size();
    client.sendMessage(ProtocolConstants.NUMBER_OF_TASKS_TO_EXECUTE, null, new Integer(taskList.size()));
}
项目:Reer    文件:BuildLogger.java   
public void graphPopulated(TaskExecutionGraph graph) {
    logger.info("Tasks to be executed: {}", graph.getAllTasks());
}
项目:Reer    文件:BuildProgressFilter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    if (gradle != null && graph == gradle.getTaskGraph()) {
        logger.graphPopulated(graph.getAllTasks().size());
    }
}
项目:Pushjet-Android    文件:InProcessGradleExecuter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    List<Task> planned = new ArrayList<Task>(graph.getAllTasks());
    graph.addTaskExecutionListener(new TaskListenerImpl(planned, executedTasks, skippedTasks));
}
项目:Pushjet-Android    文件:ExecuteGradleCommandClientProtocol.java   
public void graphPopulated(TaskExecutionGraph taskExecutionGraph) {
    List<Task> taskList = taskExecutionGraph.getAllTasks();

    this.totalTasksToExecute = taskList.size();
    client.sendMessage(ProtocolConstants.NUMBER_OF_TASKS_TO_EXECUTE, null, new Integer(taskList.size()));
}
项目:Pushjet-Android    文件:BuildProgressFilter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    if (gradle != null && graph == gradle.getTaskGraph()) {
        logger.graphPopulated(graph.getAllTasks().size());
    }
}
项目:Pushjet-Android    文件:BuildLogger.java   
public void graphPopulated(TaskExecutionGraph graph) {
    logger.info(String.format("Tasks to be executed: %s", graph.getAllTasks()));
}
项目:Pushjet-Android    文件:InProcessGradleExecuter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    List<Task> planned = new ArrayList<Task>(graph.getAllTasks());
    graph.addTaskExecutionListener(new TaskListenerImpl(planned, executedTasks, skippedTasks));
}
项目:Pushjet-Android    文件:ExecuteGradleCommandClientProtocol.java   
public void graphPopulated(TaskExecutionGraph taskExecutionGraph) {
    List<Task> taskList = taskExecutionGraph.getAllTasks();

    this.totalTasksToExecute = taskList.size();
    client.sendMessage(ProtocolConstants.NUMBER_OF_TASKS_TO_EXECUTE, null, new Integer(taskList.size()));
}
项目:Pushjet-Android    文件:BuildProgressFilter.java   
public void graphPopulated(TaskExecutionGraph graph) {
    if (gradle != null && graph == gradle.getTaskGraph()) {
        logger.graphPopulated(graph.getAllTasks().size());
    }
}
项目:Pushjet-Android    文件:BuildLogger.java   
public void graphPopulated(TaskExecutionGraph graph) {
    logger.info(String.format("Tasks to be executed: %s", graph.getAllTasks()));
}
项目:spotless    文件:SpotlessPlugin.java   
@SuppressWarnings("rawtypes")
void createTasks(Project project) {
    Task rootCheckTask = project.task(EXTENSION + CHECK);
    rootCheckTask.setGroup(TASK_GROUP);
    rootCheckTask.setDescription(CHECK_DESCRIPTION);
    Task rootApplyTask = project.task(EXTENSION + APPLY);
    rootApplyTask.setGroup(TASK_GROUP);
    rootApplyTask.setDescription(APPLY_DESCRIPTION);

    spotlessExtension.formats.forEach((key, value) -> {
        // create the task that does the work
        String taskName = EXTENSION + capitalize(key);
        SpotlessTask spotlessTask = project.getTasks().create(taskName, SpotlessTask.class);
        value.setupTask(spotlessTask);

        // create the check and apply control tasks
        Task checkTask = project.getTasks().create(taskName + CHECK);
        Task applyTask = project.getTasks().create(taskName + APPLY);
        // the root tasks depend on them
        rootCheckTask.dependsOn(checkTask);
        rootApplyTask.dependsOn(applyTask);
        // and they depend on the work task
        checkTask.dependsOn(spotlessTask);
        applyTask.dependsOn(spotlessTask);

        // when the task graph is ready, we'll configure the spotlessTask appropriately
        project.getGradle().getTaskGraph().whenReady(new Closure(null) {
            private static final long serialVersionUID = 1L;

            // called by gradle
            @SuppressFBWarnings("UMAC_UNCALLABLE_METHOD_OF_ANONYMOUS_CLASS")
            public Object doCall(TaskExecutionGraph graph) {
                if (graph.hasTask(checkTask)) {
                    spotlessTask.setCheck();
                }
                if (graph.hasTask(applyTask)) {
                    spotlessTask.setApply();
                }
                return Closure.DONE;
            }
        });
    });

    // Add our check task as a dependency on the global check task
    // getTasks() returns a "live" collection, so this works even if the
    // task doesn't exist at the time this call is made
    if (spotlessExtension.enforceCheck) {
        project.getTasks()
                .matching(task -> task.getName().equals(JavaBasePlugin.CHECK_TASK_NAME))
                .all(task -> task.dependsOn(rootCheckTask));
    }

    // clear spotless' cache when the user does a clean, but only after any spotless tasks
    Task clean = project.getTasks().getByName(BasePlugin.CLEAN_TASK_NAME);
    clean.doLast(unused -> SpotlessCache.clear());
    project.getTasks()
            .withType(SpotlessTask.class)
            .all(task -> task.mustRunAfter(clean));
}
项目:Reer    文件:Gradle.java   
/**
 * Returns the {@link TaskExecutionGraph} for this build.
 *
 * @return The task graph. Never returns null.
 */
TaskExecutionGraph getTaskGraph();
项目:Pushjet-Android    文件:Gradle.java   
/**
 * Returns the {@link TaskExecutionGraph} for this build.
 *
 * @return The task graph. Never returns null.
 */
TaskExecutionGraph getTaskGraph();
项目:Pushjet-Android    文件:Gradle.java   
/**
 * Returns the {@link TaskExecutionGraph} for this build.
 *
 * @return The task graph. Never returns null.
 */
TaskExecutionGraph getTaskGraph();