Skip to content

Update to latest Eclipse 2019-09 #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<main.basedir>${basedir}</main.basedir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<eclipse.repository>https://download.eclipse.org/releases/2019-03/201903201000</eclipse.repository>
<eclipse.repository>https://download.eclipse.org/releases/2019-09/201909181001/</eclipse.repository>
<eclipse.checkstyle.repository>https://dl.bintray.com/eclipse-cs/eclipse-cs/8.18.0</eclipse.checkstyle.repository>
<tycho.disableP2Mirrors>true</tycho.disableP2Mirrors>
<ant.version>1.8.1</ant.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.m2e.jdt;resolution:=optional,
org.eclipse.m2e.core;resolution:=optional,
org.eclipse.m2e.maven.runtime;resolution:=optional,
org.eclipse.buildship.core;bundle-version="[3.0.0,3.1.0)";resolution:=optional,
org.eclipse.buildship.core;bundle-version="[3.0.0,3.3.0)";resolution:=optional,
net.sf.eclipsecs.core;bundle-version="8.18.0";resolution:=optional
Bundle-ClassPath: .,
lib/spring-javaformat-formatter-eclipse.jar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Optional;
import java.util.Set;
Expand All @@ -30,7 +31,6 @@
import org.eclipse.buildship.core.internal.workspace.FetchStrategy;
import org.eclipse.buildship.core.internal.workspace.InternalGradleBuild;
import org.eclipse.buildship.core.internal.workspace.InternalGradleWorkspace;
import org.eclipse.buildship.core.internal.workspace.ModelProviderUtil;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Expand Down Expand Up @@ -74,16 +74,16 @@ private void configureProject(IProject project, IProgressMonitor monitor) throws
InternalGradleWorkspace workspace = CorePlugin.internalGradleWorkspace();
Optional<GradleBuild> build = workspace.getBuild(project);
if (build.isPresent()) {
Set<EclipseProject> projects = ModelProviderUtil.fetchAllEclipseProjects((InternalGradleBuild) build.get(),
this.tokenSource, FetchStrategy.FORCE_RELOAD, monitor);
Collection<EclipseProject> projects = ((InternalGradleBuild) build.get()).getModelProvider()
.fetchModels(EclipseProject.class, FetchStrategy.FORCE_RELOAD, this.tokenSource, monitor);
if (hasSpringFormatPlugin(projects)) {
ProjectSettingsFilesLocator locator = new ProjectSettingsFilesLocator(getSearchFolders(projects));
locator.locateSettingsFiles().applyToProject(project, monitor);
}
}
}

private boolean hasSpringFormatPlugin(Set<EclipseProject> projects) {
private boolean hasSpringFormatPlugin(Collection<EclipseProject> projects) {
for (EclipseProject project : projects) {
for (GradleTask task : project.getGradleProject().getTasks()) {
if (isSpringFormatPlugin(task)) {
Expand All @@ -98,7 +98,7 @@ private boolean isSpringFormatPlugin(GradleTask task) {
return TASK_NAME.equals(task.getName());
}

private Set<File> getSearchFolders(Set<EclipseProject> projects) {
private Set<File> getSearchFolders(Collection<EclipseProject> projects) {
Set<File> searchFolders = new LinkedHashSet<>();
for (EclipseProject project : projects) {
while (project != null) {
Expand Down