3131import org .eclipse .core .resources .IProject ;
3232import org .eclipse .core .resources .IResourceDelta ;
3333import org .eclipse .core .resources .IncrementalProjectBuilder ;
34+ import org .eclipse .core .resources .ResourcesPlugin ;
3435import org .eclipse .core .runtime .CoreException ;
3536import org .eclipse .core .runtime .IProgressMonitor ;
3637import org .eclipse .core .runtime .Path ;
38+ import org .eclipse .core .runtime .preferences .InstanceScope ;
3739import org .eclipse .jst .common .project .facet .core .JavaFacet ;
3840import org .eclipse .jst .j2ee .web .project .facet .WebFacetUtils ;
41+ import org .eclipse .ui .preferences .ScopedPreferenceStore ;
3942import org .eclipse .wst .common .project .facet .core .IFacetedProject ;
4043import org .eclipse .wst .common .project .facet .core .IFacetedProject .Action ;
4144import org .eclipse .wst .common .project .facet .core .ProjectFacetsManager ;
@@ -53,6 +56,19 @@ public class AppEngineWebBuilder extends IncrementalProjectBuilder {
5356 @ Override
5457 protected IProject [] build (int kind , Map <String , String > args , IProgressMonitor monitor )
5558 throws CoreException {
59+ ScopedPreferenceStore resourcesPluginPrefs = new ScopedPreferenceStore (InstanceScope .INSTANCE , ResourcesPlugin .PI_RESOURCES );
60+ boolean old = resourcesPluginPrefs .getBoolean (ResourcesPlugin .PREF_AUTO_REFRESH );
61+ resourcesPluginPrefs .setValue (ResourcesPlugin .PREF_AUTO_REFRESH , false );
62+ try {
63+ return doBuild (kind , args , monitor );
64+ } finally {
65+ resourcesPluginPrefs .setValue (ResourcesPlugin .PREF_AUTO_REFRESH , old );
66+ }
67+
68+ }
69+
70+ private IProject [] doBuild (int kind , Map <String , String > args , IProgressMonitor monitor )
71+ throws CoreException {
5672 IFacetedProject project = ProjectFacetsManager .create (getProject ());
5773 if (project == null || !AppEngineStandardFacet .hasFacet (project )) {
5874 logger .fine (getProject () + ": no build required: no App Engine Standard facet" );
0 commit comments