Search in sources :

Example 1 with DefaultEclipseBuildCommand

use of org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseBuildCommand in project gradle by gradle.

the class EclipseModelBuilder method populateEclipseProject.

private static void populateEclipseProject(DefaultEclipseProject eclipseProject, org.gradle.plugins.ide.eclipse.model.Project xmlProject) {
    List<DefaultEclipseLinkedResource> linkedResources = new LinkedList<>();
    for (Link r : xmlProject.getLinkedResources()) {
        linkedResources.add(new DefaultEclipseLinkedResource(r.getName(), r.getType(), r.getLocation(), r.getLocationUri()));
    }
    eclipseProject.setLinkedResources(linkedResources);
    List<DefaultEclipseProjectNature> natures = new ArrayList<>();
    for (String n : xmlProject.getNatures()) {
        natures.add(new DefaultEclipseProjectNature(n));
    }
    eclipseProject.setProjectNatures(natures);
    List<DefaultEclipseBuildCommand> buildCommands = new ArrayList<>();
    for (BuildCommand b : xmlProject.getBuildCommands()) {
        Map<String, String> arguments = Maps.newLinkedHashMap();
        for (Map.Entry<String, String> entry : b.getArguments().entrySet()) {
            arguments.put(convertGString(entry.getKey()), convertGString(entry.getValue()));
        }
        buildCommands.add(new DefaultEclipseBuildCommand(b.getName(), arguments));
    }
    eclipseProject.setBuildCommands(buildCommands);
}
Also used : DefaultEclipseLinkedResource(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseLinkedResource) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) DefaultEclipseProjectNature(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProjectNature) DefaultEclipseBuildCommand(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseBuildCommand) BuildCommand(org.gradle.plugins.ide.eclipse.model.BuildCommand) DefaultEclipseBuildCommand(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseBuildCommand) Map(java.util.Map) HashMap(java.util.HashMap) Link(org.gradle.plugins.ide.eclipse.model.Link)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 BuildCommand (org.gradle.plugins.ide.eclipse.model.BuildCommand)1 Link (org.gradle.plugins.ide.eclipse.model.Link)1 DefaultEclipseBuildCommand (org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseBuildCommand)1 DefaultEclipseLinkedResource (org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseLinkedResource)1 DefaultEclipseProjectNature (org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProjectNature)1