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


Java Task.setGroup方法代码示例

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


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

示例1: apply

import org.gradle.api.Task; //导入方法依赖的package包/类
public void apply(final Project project) {
    RepositoryHandler repositories = publicationServices.createRepositoryHandler();
    PublicationContainer publications = instantiator.newInstance(DefaultPublicationContainer.class, instantiator);

    // TODO Registering an extension should register it with the model registry as well
    project.getExtensions().create(PublishingExtension.NAME, DefaultPublishingExtension.class, repositories, publications);

    Task publishLifecycleTask = project.getTasks().create(PUBLISH_LIFECYCLE_TASK_NAME);
    publishLifecycleTask.setDescription("Publishes all publications produced by this project.");
    publishLifecycleTask.setGroup(PUBLISH_TASK_GROUP);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PublishingPlugin.java

示例2: addAssembleTask

import org.gradle.api.Task; //导入方法依赖的package包/类
private void addAssembleTask(Project project, Distribution distribution, Task... tasks) {
    String taskName = TASK_ASSEMBLE_NAME;
    if (!MAIN_DISTRIBUTION_NAME.equals(distribution.getName())) {
        taskName = "assemble" + StringGroovyMethods.capitalize(distribution.getName()) + "Dist";
    }

    Task assembleTask = project.getTasks().create(taskName);
    assembleTask.setDescription("Assembles the " + distribution.getName() + " distributions");
    assembleTask.setGroup(DISTRIBUTION_GROUP);
    assembleTask.dependsOn((Object[]) tasks);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DistributionPlugin.java

示例3: createBinaryLifecycleTask

import org.gradle.api.Task; //导入方法依赖的package包/类
private void createBinaryLifecycleTask(SourceSet sourceSet, Project target) {
    sourceSet.compiledBy(sourceSet.getClassesTaskName());

    Task binaryLifecycleTask = target.task(sourceSet.getClassesTaskName());
    binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
    binaryLifecycleTask.setDescription("Assembles " + sourceSet.getOutput() + ".");
    binaryLifecycleTask.dependsOn(sourceSet.getOutput().getDirs());
    binaryLifecycleTask.dependsOn(sourceSet.getCompileJavaTaskName());
    binaryLifecycleTask.dependsOn(sourceSet.getProcessResourcesTaskName());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:JavaBasePlugin.java

示例4: apply

import org.gradle.api.Task; //导入方法依赖的package包/类
@Override
public void apply(Project project) {
    project.getPluginManager().apply(ReportingBasePlugin.class);
    final ProjectReportsPluginConvention convention = new ProjectReportsPluginConvention(project);
    project.getConvention().getPlugins().put("projectReports", convention);

    TaskReportTask taskReportTask = project.getTasks().create(TASK_REPORT, TaskReportTask.class);
    taskReportTask.setDescription("Generates a report about your tasks.");
    taskReportTask.conventionMapping("outputFile", new Callable<Object>() {
        public Object call() throws Exception {
            return new File(convention.getProjectReportDir(), "tasks.txt");
        }
    });
    taskReportTask.conventionMapping("projects", new Callable<Object>() {
        public Object call() throws Exception {
            return convention.getProjects();
        }
    });

    PropertyReportTask propertyReportTask = project.getTasks().create(PROPERTY_REPORT, PropertyReportTask.class);
    propertyReportTask.setDescription("Generates a report about your properties.");
    propertyReportTask.conventionMapping("outputFile", new Callable<Object>() {
        public Object call() throws Exception {
            return new File(convention.getProjectReportDir(), "properties.txt");
        }
    });
    propertyReportTask.conventionMapping("projects", new Callable<Object>() {
        public Object call() throws Exception {
            return convention.getProjects();
        }
    });

    DependencyReportTask dependencyReportTask = project.getTasks().create(DEPENDENCY_REPORT,
            DependencyReportTask.class);
    dependencyReportTask.setDescription("Generates a report about your library dependencies.");
    dependencyReportTask.conventionMapping("outputFile", new Callable<Object>() {
        public Object call() throws Exception {
            return new File(convention.getProjectReportDir(), "dependencies.txt");
        }
    });
    dependencyReportTask.conventionMapping("projects", new Callable<Object>() {
        public Object call() throws Exception {
            return convention.getProjects();
        }
    });

    HtmlDependencyReportTask htmlDependencyReportTask = project.getTasks().create(HTML_DEPENDENCY_REPORT,
            HtmlDependencyReportTask.class);
    htmlDependencyReportTask.setDescription("Generates an HTML report about your library dependencies.");
    new DslObject(htmlDependencyReportTask.getReports().getHtml()).getConventionMapping().map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return new File(convention.getProjectReportDir(), "dependencies");
        }
    });
    htmlDependencyReportTask.conventionMapping("projects", new Callable<Object>() {
        public Object call() throws Exception {
            return convention.getProjects();
        }
    });

    Task projectReportTask = project.getTasks().create(PROJECT_REPORT);
    projectReportTask.dependsOn(TASK_REPORT, PROPERTY_REPORT, DEPENDENCY_REPORT, HTML_DEPENDENCY_REPORT);
    projectReportTask.setDescription("Generates a report about your project.");
    projectReportTask.setGroup("reporting");
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:66,代码来源:ProjectReportsPlugin.java


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