use of org.eclipse.buildship.core.internal.workspace.InternalGradleBuild in project eclipse.jdt.ls by eclipse.
the class GradleBuildSupport method isRoot.
private boolean isRoot(IProject project, GradleBuild gradleBuild, IProgressMonitor monitor) {
if (gradleBuild instanceof InternalGradleBuild) {
CancellationTokenSource tokenSource = GradleConnector.newCancellationTokenSource();
Map<String, EclipseProject> eclipseProjects = ((InternalGradleBuild) gradleBuild).getModelProvider().fetchModels(EclipseProject.class, FetchStrategy.LOAD_IF_NOT_CACHED, tokenSource, monitor);
File projectDirectory = project.getLocation().toFile();
for (EclipseProject eclipseProject : eclipseProjects.values()) {
File eclipseProjectDirectory = eclipseProject.getProjectDirectory();
if (eclipseProjectDirectory.equals(projectDirectory)) {
return eclipseProject.getParent() == null;
}
}
}
return false;
}
Aggregations