fix - Delete the gradle build server projects in workspace when failed resolving

This commit is contained in:
Jiaming 2024-08-12 11:30:34 +08:00 коммит произвёл GitHub
Родитель b31d370333
Коммит fd29348c1c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -23,6 +23,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
@ -249,9 +250,15 @@ public class GradleBuildServerProjectImporter extends AbstractProjectImporter {
// TOOD: Once the upstream GradleProjectImporter has been updated to not import when
// the gradle project has already imported by other importers, we can modify this logic
// so that Maven importer can be involved for other projects.
if (!this.isResolved){
if (!this.isResolved) {
for (IProject project : ProjectUtils.getAllProjects()) {
if (Utils.isGradleBuildServerProject(project)) {
project.delete(IResource.NEVER_DELETE_PROJECT_CONTENT, new NullProgressMonitor());
}
}
return false;
}
for (IProject project : ProjectUtils.getAllProjects()) {
if (Utils.isGradleBuildServerProject(project) &&
project.getLocation().toPath().startsWith(folder.toPath())) {