use of org.gradle.tooling.internal.gradle.BasicGradleProject in project gradle by gradle.
the class GradleBuildBuilder method convert.
private DefaultGradleBuild convert(Gradle gradle) {
DefaultGradleBuild model = new DefaultGradleBuild();
Map<Project, BasicGradleProject> convertedProjects = new LinkedHashMap<Project, BasicGradleProject>();
Project rootProject = gradle.getRootProject();
BasicGradleProject convertedRootProject = convert(rootProject, convertedProjects);
model.setRootProject(convertedRootProject);
for (Project project : rootProject.getAllprojects()) {
model.addProject(convertedProjects.get(project));
}
for (IncludedBuild includedBuild : gradle.getIncludedBuilds()) {
Gradle includedGradle = ((IncludedBuildInternal) includedBuild).getConfiguredBuild();
DefaultGradleBuild convertedIncludedBuild = convert(includedGradle);
model.addIncludedBuild(convertedIncludedBuild);
}
return model;
}
use of org.gradle.tooling.internal.gradle.BasicGradleProject in project gradle by gradle.
the class GradleBuildBuilder method convert.
private BasicGradleProject convert(Project project, Map<Project, BasicGradleProject> convertedProjects) {
DefaultProjectIdentifier id = new DefaultProjectIdentifier(project.getRootDir(), project.getPath());
BasicGradleProject converted = new BasicGradleProject().setName(project.getName()).setProjectIdentifier(id);
converted.setProjectDirectory(project.getProjectDir());
if (project.getParent() != null) {
converted.setParent(convertedProjects.get(project.getParent()));
}
convertedProjects.put(project, converted);
for (Project child : project.getChildProjects().values()) {
converted.addChild(convert(child, convertedProjects));
}
return converted;
}
Aggregations