18
18
19
19
import java .io .File ;
20
20
import java .io .IOException ;
21
+ import java .util .Collection ;
21
22
import java .util .LinkedHashSet ;
22
23
import java .util .Optional ;
23
24
import java .util .Set ;
24
25
25
26
import org .eclipse .buildship .core .GradleBuild ;
26
27
import org .eclipse .buildship .core .internal .CorePlugin ;
27
- import org .eclipse .buildship .core .internal .workspace .FetchStrategy ;
28
28
import org .eclipse .buildship .core .internal .workspace .InternalGradleBuild ;
29
29
import org .eclipse .buildship .core .internal .workspace .InternalGradleWorkspace ;
30
- import org .eclipse .buildship .core .internal .workspace .ModelProviderUtil ;
31
30
import org .eclipse .core .resources .IProject ;
32
31
import org .eclipse .core .resources .ResourcesPlugin ;
33
32
import org .eclipse .core .runtime .CoreException ;
@@ -86,15 +85,15 @@ private void configureProjects(IProgressMonitor monitor) throws CoreException, I
86
85
87
86
private void configureProject (IProject project , InternalGradleBuild build , IProgressMonitor monitor )
88
87
throws CoreException , IOException {
89
- Set <EclipseProject > projects = ModelProviderUtil . fetchAllEclipseProjects ( build , this . tokenSource ,
90
- FetchStrategy . FORCE_RELOAD , monitor );
88
+ Collection <EclipseProject > projects = build . getModelProvider ()
89
+ . fetchEclipseProjectAndRunSyncTasks ( this . tokenSource , monitor );
91
90
if (hasSpringFormatPlugin (projects )) {
92
91
ProjectSettingsFilesLocator locator = new ProjectSettingsFilesLocator (getSearchFolders (projects ));
93
92
locator .locateSettingsFiles ().applyToProject (project , monitor );
94
93
}
95
94
}
96
95
97
- private boolean hasSpringFormatPlugin (Set <EclipseProject > projects ) {
96
+ private boolean hasSpringFormatPlugin (Collection <EclipseProject > projects ) {
98
97
for (EclipseProject project : projects ) {
99
98
for (GradleTask task : project .getGradleProject ().getTasks ()) {
100
99
if (isSpringFormatPlugin (task )) {
@@ -109,7 +108,7 @@ private boolean isSpringFormatPlugin(GradleTask task) {
109
108
return TASK_NAME .equals (task .getName ());
110
109
}
111
110
112
- private Set <File > getSearchFolders (Set <EclipseProject > projects ) {
111
+ private Set <File > getSearchFolders (Collection <EclipseProject > projects ) {
113
112
Set <File > searchFolders = new LinkedHashSet <>();
114
113
for (EclipseProject project : projects ) {
115
114
while (project != null ) {
0 commit comments