use of org.gradle.plugins.ide.api.XmlFileContentMerger in project gradle by gradle.
the class EclipseWtp method getFacet.
/**
* Configures wtp facet.
* <p>
* For examples see docs for {@link EclipseWtpFacet}
*/
public EclipseWtpFacet getFacet() {
if (facet == null) {
XmlTransformer xmlTransformer = new XmlTransformer();
xmlTransformer.setIndentation("\t");
facet = getObjectFactory().newInstance(EclipseWtpFacet.class, new XmlFileContentMerger(xmlTransformer));
}
return facet;
}
use of org.gradle.plugins.ide.api.XmlFileContentMerger in project gradle by gradle.
the class EclipseModelBuilder method populate.
private void populate(Project project) {
((ProjectInternal) project).getModel().applyToMutableState(state -> {
EclipseModel eclipseModel = project.getExtensions().getByType(EclipseModel.class);
boolean projectDependenciesOnly = this.projectDependenciesOnly;
ClasspathElements classpathElements = gatherClasspathElements(projectOpenStatus, eclipseModel.getClasspath(), projectDependenciesOnly);
DefaultEclipseProject eclipseProject = findEclipseProject(project);
eclipseProject.setClasspath(classpathElements.getExternalDependencies());
eclipseProject.setProjectDependencies(classpathElements.getProjectDependencies());
eclipseProject.setSourceDirectories(classpathElements.getSourceDirectories());
eclipseProject.setClasspathContainers(classpathElements.getClasspathContainers());
eclipseProject.setOutputLocation(classpathElements.getEclipseOutputLocation() != null ? classpathElements.getEclipseOutputLocation() : new DefaultEclipseOutputLocation("bin"));
eclipseProject.setAutoBuildTasks(!eclipseModel.getAutoBuildTasks().getDependencies(null).isEmpty());
org.gradle.plugins.ide.eclipse.model.Project xmlProject = new org.gradle.plugins.ide.eclipse.model.Project(new XmlTransformer());
XmlFileContentMerger projectFile = eclipseModel.getProject().getFile();
if (projectFile == null) {
xmlProject.configure(eclipseModel.getProject());
} else {
eclipseModel.getProject().mergeXmlProject(xmlProject);
}
populateEclipseProjectTasks(eclipseProject, tasksFactory.getTasks(project));
populateEclipseProject(eclipseProject, xmlProject);
populateEclipseProjectJdt(eclipseProject, eclipseModel.getJdt());
});
for (Project childProject : project.getChildProjects().values()) {
populate(childProject);
}
}
Aggregations