All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xtext.gradle.idea.IdeaRepositoryPlugin Maven / Gradle / Ivy

There is a newer version: 2.0.9-alpha.3
Show newest version
package org.xtext.gradle.idea;

import java.io.File;
import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.plugins.BasePlugin;
import org.gradle.api.plugins.PluginContainer;
import org.gradle.api.tasks.TaskContainer;
import org.xtext.gradle.idea.IdeaDevelopmentPlugin;
import org.xtext.gradle.idea.IdeaPluginPlugin;
import org.xtext.gradle.idea.tasks.GradleExtensions;
import org.xtext.gradle.idea.tasks.IdeaRepository;

@SuppressWarnings("all")
public class IdeaRepositoryPlugin implements Plugin {
  public final static String IDEA_REPOSITORY_TASK_NAME = "ideaRepository";
  
  @Override
  public void apply(final Project project) {
    PluginContainer _plugins = project.getPlugins();
    _plugins.apply(IdeaDevelopmentPlugin.class);
    TaskContainer _tasks = project.getTasks();
    final Action _function = new Action() {
      @Override
      public void execute(final IdeaRepository it) {
        it.setDescription("Creates an Idea repository from which plugins can be installed");
        it.setGroup(BasePlugin.BUILD_GROUP);
        File _buildDir = project.getBuildDir();
        File _divide = GradleExtensions.operator_divide(_buildDir, "ideaRepository");
        it.into(_divide);
      }
    };
    final IdeaRepository repositoryTask = _tasks.create(IdeaRepositoryPlugin.IDEA_REPOSITORY_TASK_NAME, IdeaRepository.class, _function);
    final Action _function_1 = new Action() {
      @Override
      public void execute(final Project p) {
        PluginContainer _plugins = p.getPlugins();
        final Action _function = new Action() {
          @Override
          public void execute(final IdeaPluginPlugin it) {
            TaskContainer _tasks = p.getTasks();
            Task _findByName = _tasks.findByName(IdeaPluginPlugin.IDEA_ZIP_TASK_NAME);
            repositoryTask.from(_findByName);
          }
        };
        _plugins.withType(IdeaPluginPlugin.class, _function);
      }
    };
    project.allprojects(_function_1);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy