Bug 77871 [GlobalActions] (Re)Build Project should track resources itself
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/BuildAction.java
IProject project = resource.getProject();
                if (project != null) {
                    if (!projectsToBuild.contains(project)) {
                        if (hasBuilder(project)) {
                            projectsToBuild.add(project);
                        }
                    }
                }
            }
        }
        return projectsToBuild;
    }
    /**
     * Returns whether there are builders configured on the given project.
     *
     * @return <code>true</code> if it has builders,
     *   <code>false</code> if not, or if this couldn't be determined
     */
    boolean hasBuilder(IProject project) {
        try {
            ICommand[] commands = project.getDescription().getBuildSpec();
            if (commands.length > 0) {
                return true;
            }
        } catch (CoreException e) {
            
            
            
            
        }