Java Code Examples for org.gradle.api.Task#setDescription()

The following examples show how to use org.gradle.api.Task#setDescription() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CreateVisualStudioTasks.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@SuppressWarnings("UnusedDeclaration")
public void createTasksForVisualStudio(TaskContainer tasks, VisualStudioExtension visualStudioExtension) {
    for (VisualStudioProject vsProject : visualStudioExtension.getProjects()) {
        vsProject.builtBy(createProjectsFileTask(tasks, vsProject));
        vsProject.builtBy(createFiltersFileTask(tasks, vsProject));
    }

    for (VisualStudioSolution vsSolution : visualStudioExtension.getSolutions()) {
        Task solutionTask = tasks.create(vsSolution.getName() + "VisualStudio");
        solutionTask.setDescription(String.format("Generates the '%s' Visual Studio solution file.", vsSolution.getName()));
        vsSolution.setLifecycleTask(solutionTask);
        vsSolution.builtBy(createSolutionTask(tasks, vsSolution));

        // Lifecycle task for component
        ProjectNativeComponent component = vsSolution.getComponent();
        Task lifecycleTask = tasks.maybeCreate(component.getName() + "VisualStudio");
        lifecycleTask.dependsOn(vsSolution);
        lifecycleTask.setGroup("IDE");
        lifecycleTask.setDescription(String.format("Generates the Visual Studio solution for %s.", component));
    }

    addCleanTask(tasks);
}
 
Example 2
Source File: LanguageBasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Mutate
void createLifecycleTaskForBinary(TaskContainer tasks, BinaryContainer binaries) {
    Task assembleTask = tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME);
    for (BinarySpecInternal binary : binaries.withType(BinarySpecInternal.class)) {
        if (!binary.isLegacyBinary()) {
            Task binaryLifecycleTask = tasks.create(binary.getNamingScheme().getLifecycleTaskName());
            binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
            binaryLifecycleTask.setDescription(String.format("Assembles %s.", binary));
            binary.setBuildTask(binaryLifecycleTask);

            if (binary.isBuildable()) {
                assembleTask.dependsOn(binary);
            }
        }
    }
}
 
Example 3
Source File: VisualStudioPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Mutate
@SuppressWarnings("GroovyUnusedDeclaration")
public static void createTasksForVisualStudio(TaskContainer tasks, VisualStudioExtensionInternal visualStudioExtension) {
    for (VisualStudioProject vsProject : visualStudioExtension.getProjects()) {
        vsProject.builtBy(createProjectsFileTask(tasks, vsProject));
        vsProject.builtBy(createFiltersFileTask(tasks, vsProject));
    }

    for (VisualStudioSolution vsSolution : visualStudioExtension.getSolutions()) {
        Task solutionTask = tasks.create(vsSolution.getName() + "VisualStudio");
        solutionTask.setDescription(String.format("Generates the '%s' Visual Studio solution file.", vsSolution.getName()));
        vsSolution.setBuildTask(solutionTask);
        vsSolution.builtBy(createSolutionTask(tasks, vsSolution));

        // Lifecycle task for component
        NativeComponentSpec component = vsSolution.getComponent();
        Task lifecycleTask = tasks.maybeCreate(component.getName() + "VisualStudio");
        lifecycleTask.dependsOn(vsSolution);
        lifecycleTask.setGroup("IDE");
        lifecycleTask.setDescription(String.format("Generates the Visual Studio solution for %s.", component));
    }

    addCleanTask(tasks);
}
 
Example 4
Source File: CreateVisualStudioTasks.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@SuppressWarnings("UnusedDeclaration")
public void createTasksForVisualStudio(TaskContainer tasks, VisualStudioExtension visualStudioExtension) {
    for (VisualStudioProject vsProject : visualStudioExtension.getProjects()) {
        vsProject.builtBy(createProjectsFileTask(tasks, vsProject));
        vsProject.builtBy(createFiltersFileTask(tasks, vsProject));
    }

    for (VisualStudioSolution vsSolution : visualStudioExtension.getSolutions()) {
        Task solutionTask = tasks.create(vsSolution.getName() + "VisualStudio");
        solutionTask.setDescription(String.format("Generates the '%s' Visual Studio solution file.", vsSolution.getName()));
        vsSolution.setLifecycleTask(solutionTask);
        vsSolution.builtBy(createSolutionTask(tasks, vsSolution));

        // Lifecycle task for component
        ProjectNativeComponent component = vsSolution.getComponent();
        Task lifecycleTask = tasks.maybeCreate(component.getName() + "VisualStudio");
        lifecycleTask.dependsOn(vsSolution);
        lifecycleTask.setGroup("IDE");
        lifecycleTask.setDescription(String.format("Generates the Visual Studio solution for %s.", component));
    }

    addCleanTask(tasks);
}
 
Example 5
Source File: VisualStudioPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Mutate
@SuppressWarnings("GroovyUnusedDeclaration")
public static void createTasksForVisualStudio(TaskContainer tasks, VisualStudioExtensionInternal visualStudioExtension) {
    for (VisualStudioProject vsProject : visualStudioExtension.getProjects()) {
        vsProject.builtBy(createProjectsFileTask(tasks, vsProject));
        vsProject.builtBy(createFiltersFileTask(tasks, vsProject));
    }

    for (VisualStudioSolution vsSolution : visualStudioExtension.getSolutions()) {
        Task solutionTask = tasks.create(vsSolution.getName() + "VisualStudio");
        solutionTask.setDescription(String.format("Generates the '%s' Visual Studio solution file.", vsSolution.getName()));
        vsSolution.setBuildTask(solutionTask);
        vsSolution.builtBy(createSolutionTask(tasks, vsSolution));

        // Lifecycle task for component
        NativeComponentSpec component = vsSolution.getComponent();
        Task lifecycleTask = tasks.maybeCreate(component.getName() + "VisualStudio");
        lifecycleTask.dependsOn(vsSolution);
        lifecycleTask.setGroup("IDE");
        lifecycleTask.setDescription(String.format("Generates the Visual Studio solution for %s.", component));
    }

    addCleanTask(tasks);
}
 
Example 6
Source File: LanguageBasePlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Mutate
void createLifecycleTaskForBinary(TaskContainer tasks, BinaryContainer binaries) {
    Task assembleTask = tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME);
    for (BinarySpecInternal binary : binaries.withType(BinarySpecInternal.class)) {
        if (!binary.isLegacyBinary()) {
            Task binaryLifecycleTask = tasks.create(binary.getNamingScheme().getLifecycleTaskName());
            binaryLifecycleTask.setGroup(LifecycleBasePlugin.BUILD_GROUP);
            binaryLifecycleTask.setDescription(String.format("Assembles %s.", binary));
            binary.setBuildTask(binaryLifecycleTask);

            if (binary.isBuildable()) {
                assembleTask.dependsOn(binary);
            }
        }
    }
}
 
Example 7
Source File: BuildConfigurationRule.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(String taskName) {
    if (taskName.startsWith(PREFIX)) {
        String configurationName = StringUtils.uncapitalize(taskName.substring(PREFIX.length()));
        Configuration configuration = configurations.findByName(configurationName);

        if (configuration != null) {
            Task task = tasks.create(taskName);
            task.dependsOn(configuration.getAllArtifacts());
            task.setDescription(String.format("Builds the artifacts belonging to %s.", configuration));
        }
    }
}
 
Example 8
Source File: BuildConfigurationRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(String taskName) {
    if (taskName.startsWith(PREFIX)) {
        String configurationName = StringUtils.uncapitalize(taskName.substring(PREFIX.length()));
        Configuration configuration = configurations.findByName(configurationName);

        if (configuration != null) {
            Task task = tasks.create(taskName);
            task.dependsOn(configuration.getAllArtifacts());
            task.setDescription(String.format("Builds the artifacts belonging to %s.", configuration));
        }
    }
}
 
Example 9
Source File: BuildConfigurationRule.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(String taskName) {
    if (taskName.startsWith(PREFIX)) {
        String configurationName = StringUtils.uncapitalize(taskName.substring(PREFIX.length()));
        Configuration configuration = configurations.findByName(configurationName);

        if (configuration != null) {
            Task task = tasks.create(taskName);
            task.dependsOn(configuration.getAllArtifacts());
            task.setDescription(String.format("Builds the artifacts belonging to %s.", configuration));
        }
    }
}
 
Example 10
Source File: PluginClean.java    From scaffold-clean-architecture with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void appendTask(TaskModel t) {
    Task temp = taskContainer.create(t.getName(), t.getTaskAction());
    taskContainer.create(t.getShortcut(), t.getTaskAction());
    temp.setGroup(t.getGroup());
    temp.setDescription(t.getDescription());
}
 
Example 11
Source File: CloudServicesPackagingPlugin.java    From commerce-gradle-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void apply(Project project) {
    PackagingExtension extension = project.getExtensions().create(EXTENSION, PackagingExtension.class, project);
    extension.getPlatformZip().set(project.file("hybris/temp/hybris/hybrisServer/hybrisServer-Platform.zip"));
    extension.getAllExtensionsZip().set(project.file("hybris/temp/hybris/hybrisServer/hybrisServer-AllExtensions.zip"));
    extension.getEnvironments().set(project.provider(() -> new HashSet<>(Arrays.asList("dev", "stag", "prod"))));
    extension.getPreProductionEnvironment().set("stag");
    extension.getProjectID().set(project.provider(project::getName));

    extension.getConfigurationFolder().set(project.file("ccv1-configuration"));
    extension.getDistributionFolder().set(project.file("dist"));
    extension.getTempFolder().set(project.file("temp"));


    Task bootstrap = project.getTasks().create("bootstrapCCV1Config");
    bootstrap.setGroup(GROUP);
    bootstrap.setDescription("Creates environment config folders, if they don't exist");
    project.afterEvaluate(p -> setupBootstrap(p, bootstrap, extension));

    Delete cleanTempFolder = project.getTasks().create("cleanTemp", Delete.class, t -> {
        t.delete(extension.getTempFolder());
    });
    cleanTempFolder.setGroup(GROUP);
    cleanTempFolder.setDescription("cleans temp folder used to assemble the final package");

    Task buildPackage = project.getTasks().create("buildCCV1Package");
    buildPackage.setGroup(GROUP);
    buildPackage.setDescription("Builds a distribution package based on Deployment Packaging Guidelines (v.2.3.3)");
    project.afterEvaluate(p -> setupPackaging(p, buildPackage, extension));

    project.getPlugins().withType(HybrisPlugin.class, hybrisPlugin -> {
        //sensible defaults
        buildPackage.mustRunAfter(project.getTasks().getByPath("yproduction"));
    });
}
 
Example 12
Source File: JavaBasePlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
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());
}
 
Example 13
Source File: BasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void addAssemble(Project project) {
    Task assembleTask = project.getTasks().create(ASSEMBLE_TASK_NAME);
    assembleTask.setDescription("Assembles the outputs of this project.");
    assembleTask.setGroup(BUILD_GROUP);
    assembleTask.dependsOn(project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts().getBuildDependencies());
}
 
Example 14
Source File: ProjectReportsPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Project project) {
    project.getPlugins().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");
}
 
Example 15
Source File: ProjectReportsPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Project project) {
    project.getPlugins().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");
}
 
Example 16
Source File: BasePlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void addAssemble(Project project) {
    Task assembleTask = project.getTasks().create(ASSEMBLE_TASK_NAME);
    assembleTask.setDescription("Assembles the outputs of this project.");
    assembleTask.setGroup(BUILD_GROUP);
    assembleTask.dependsOn(project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION).getAllArtifacts().getBuildDependencies());
}
 
Example 17
Source File: BaseComponentModelPlugin.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
public void modifyAssembleTaskDescription(@Path("tasks.assemble") Task assembleTask) {
    assembleTask.setDescription(
            "Assembles all variants of all applications and secondary packages.");
}
 
Example 18
Source File: ProjectReportsPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Project project) {
    project.getPlugins().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");
}
 
Example 19
Source File: LifecycleBasePlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void addAssemble(Project project) {
    Task assembleTask = project.getTasks().create(ASSEMBLE_TASK_NAME);
    assembleTask.setDescription("Assembles the outputs of this project.");
    assembleTask.setGroup(BUILD_GROUP);
}
 
Example 20
Source File: ClientPlugin.java    From client-gradle-plugin with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private void createTask(String name, Class<? extends Task> taskClass, String decription) {
	Task t = project.getTasks().create(name, taskClass, project);
	t.setGroup("Gluon client");
	t.setDescription(decription);
}