Search in sources :

Example 1 with WtpClasspathAttributeSupport

use of org.gradle.plugins.ide.eclipse.model.internal.WtpClasspathAttributeSupport in project gradle by gradle.

the class EclipseWtpPlugin method configureEclipseClasspath.

private void configureEclipseClasspath(final Project project, final EclipseModel model) {
    project.getPlugins().withType(JavaPlugin.class, new Action<JavaPlugin>() {

        @Override
        public void execute(JavaPlugin javaPlugin) {
            AfterEvaluateHelper.afterEvaluateOrExecute(project, new Action<Project>() {

                @Override
                public void execute(Project project) {
                    Collection<Configuration> plusConfigurations = model.getClasspath().getPlusConfigurations();
                    EclipseWtpComponent component = model.getWtp().getComponent();
                    plusConfigurations.addAll(component.getRootConfigurations());
                    plusConfigurations.addAll(component.getLibConfigurations());
                }
            });
            model.getClasspath().getFile().whenMerged(new Action<Classpath>() {

                @Override
                public void execute(Classpath classpath) {
                    new WtpClasspathAttributeSupport(project, model).enhance(classpath);
                }
            });
        }
    });
    project.getPlugins().withType(WarPlugin.class, new Action<WarPlugin>() {

        @Override
        public void execute(WarPlugin warPlugin) {
            model.getClasspath().containers(WEB_LIBS_CONTAINER);
        }
    });
}
Also used : Project(org.gradle.api.Project) Action(org.gradle.api.Action) WtpClasspathAttributeSupport(org.gradle.plugins.ide.eclipse.model.internal.WtpClasspathAttributeSupport) Configuration(org.gradle.api.artifacts.Configuration) Classpath(org.gradle.plugins.ide.eclipse.model.Classpath) EclipseWtpComponent(org.gradle.plugins.ide.eclipse.model.EclipseWtpComponent) JavaPlugin(org.gradle.api.plugins.JavaPlugin) WarPlugin(org.gradle.api.plugins.WarPlugin)

Aggregations

Action (org.gradle.api.Action)1 Project (org.gradle.api.Project)1 Configuration (org.gradle.api.artifacts.Configuration)1 JavaPlugin (org.gradle.api.plugins.JavaPlugin)1 WarPlugin (org.gradle.api.plugins.WarPlugin)1 Classpath (org.gradle.plugins.ide.eclipse.model.Classpath)1 EclipseWtpComponent (org.gradle.plugins.ide.eclipse.model.EclipseWtpComponent)1 WtpClasspathAttributeSupport (org.gradle.plugins.ide.eclipse.model.internal.WtpClasspathAttributeSupport)1