当前位置: 首页>>代码示例>>Java>>正文


Java Task.getProject方法代码示例

本文整理汇总了Java中org.gradle.api.Task.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java Task.getProject方法的具体用法?Java Task.getProject怎么用?Java Task.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.api.Task的用法示例。


在下文中一共展示了Task.getProject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.gradle.api.Task; //导入方法依赖的package包/类
public TaskDetails create(final Task task) {
    final String path;
    Project project = task.getProject();
    if (projects.contains(project)) {
        path = this.project.relativeProjectPath(task.getPath());
    } else {
        path = task.getPath();
    }
    return new TaskDetails() {
        public Path getPath() {
            return Path.path(path);
        }

        public String getDescription() {
            return task.getDescription();
        }
    };
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:19,代码来源:TaskDetailsFactory.java

示例2: buildFromTask

import org.gradle.api.Task; //导入方法依赖的package包/类
public static <T extends LaunchableGradleTask> T buildFromTask(T target, Task task) {
    Project project = task.getProject();
    target.setPath(task.getPath())
            .setName(task.getName())
            .setGroup(task.getGroup())
            .setDisplayName(task.toString())
            .setDescription(task.getDescription())
            .setPublic(PublicTaskSpecification.INSTANCE.isSatisfiedBy(task))
            .setProjectIdentifier(new DefaultProjectIdentifier(project.getRootDir(), project.getPath()));
    return target;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:ToolingModelBuilderSupport.java

示例3: afterExecute

import org.gradle.api.Task; //导入方法依赖的package包/类
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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:ProfileEventAdapter.java

示例4: isSatisfiedBy

import org.gradle.api.Task; //导入方法依赖的package包/类
public boolean isSatisfiedBy(Task element) {
    if (!element.getName().equals(taskName)) {
        return true;
    }
    for (Project current = element.getProject(); current != null; current = current.getParent()) {
        if (current.equals(targetProject)) {
            return false;
        }
    }
    return true;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:TaskSelector.java

示例5: graphPopulated

import org.gradle.api.Task; //导入方法依赖的package包/类
@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();
        }
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:SelectedTaskExecutionAction.java

示例6: beforeExecute

import org.gradle.api.Task; //导入方法依赖的package包/类
public void beforeExecute(Task task) {
    long now = timeProvider.getCurrentTime();
    Project project = task.getProject();
    ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath());
    projectProfile.getTaskProfile(task.getPath()).setStart(now);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:ProfileEventAdapter.java

示例7: addDependsOnTaskInOtherProjects

import org.gradle.api.Task; //导入方法依赖的package包/类
/**
 * Adds a dependency on tasks with the specified name in other projects.  The other projects are determined from
 * project lib dependencies using the specified configuration name. These may be projects this project depends on or
 * projects that depend on this project based on the useDependOn argument.
 *
 * @param task Task to add dependencies to
 * @param useDependedOn if true, add tasks from projects this project depends on, otherwise use projects that depend
 * on this one.
 * @param otherProjectTaskName name of task in other projects
 * @param configurationName name of configuration to use to find the other projects
 */
private void addDependsOnTaskInOtherProjects(final Task task, boolean useDependedOn, String otherProjectTaskName,
                                             String configurationName) {
    Project project = task.getProject();
    final Configuration configuration = project.getConfigurations().getByName(configurationName);
    task.dependsOn(configuration.getTaskDependencyFromProjectDependency(useDependedOn, otherProjectTaskName));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:18,代码来源:JavaPlugin.java


注:本文中的org.gradle.api.Task.getProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。