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);
}
Aggregations