use of org.gradle.tooling.internal.gradle.PartialBasicGradleProject in project gradle by gradle.
the class GradleBuildConverter method toPartialGradleProject.
private PartialBasicGradleProject toPartialGradleProject(GradleProject childProject) {
PartialBasicGradleProject basicGradleProject = new PartialBasicGradleProject();
basicGradleProject.setName(childProject.getName());
ProjectIdentifier id = childProject.getProjectIdentifier();
basicGradleProject.setProjectIdentifier(new DefaultProjectIdentifier(id.getBuildIdentifier().getRootDir(), id.getProjectPath()));
return basicGradleProject;
}
use of org.gradle.tooling.internal.gradle.PartialBasicGradleProject in project gradle by gradle.
the class GradleBuildConverter method convert.
public DefaultGradleBuild convert(GradleProject project) {
DefaultGradleBuild gradleBuild = new DefaultGradleBuild();
PartialBasicGradleProject rootProject = toPartialGradleProject(project);
gradleBuild.setRootProject(rootProject);
gradleBuild.addProject(rootProject);
convertChildren(gradleBuild, rootProject, project);
return gradleBuild;
}
use of org.gradle.tooling.internal.gradle.PartialBasicGradleProject in project gradle by gradle.
the class GradleBuildConverter method convertChildren.
private void convertChildren(DefaultGradleBuild gradleBuild, PartialBasicGradleProject rootProject, GradleProject project) {
final List<? extends GradleProject> childProjects = new ArrayList<GradleProject>(project.getChildren());
Collections.sort(childProjects, new Comparator<GradleProject>() {
public int compare(GradleProject gp1, GradleProject gp2) {
return gp1.getName().compareTo(gp2.getName());
}
});
for (GradleProject childProject : childProjects) {
PartialBasicGradleProject basicGradleProject = toPartialGradleProject(childProject);
gradleBuild.addProject(basicGradleProject);
basicGradleProject.setParent(rootProject);
rootProject.addChild(basicGradleProject);
convertChildren(gradleBuild, basicGradleProject, childProject);
}
}
Aggregations