Exemplo n.º 1
0
    @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
        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);
    }
Exemplo n.º 2
0
 private static Task createProjectsFileTask(TaskContainer tasks, VisualStudioProject vsProject) {
   GenerateProjectFileTask task =
       tasks.create(vsProject.getName() + "VisualStudioProject", GenerateProjectFileTask.class);
   task.setVisualStudioProject(vsProject);
   task.initGradleCommand();
   return task;
 }
Exemplo n.º 3
0
 private static Task createFiltersFileTask(TaskContainer tasks, VisualStudioProject vsProject) {
   GenerateFiltersFileTask task =
       tasks.create(vsProject.getName() + "VisualStudioFilters", GenerateFiltersFileTask.class);
   task.setVisualStudioProject(vsProject);
   return task;
 }