mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 133881 - Make refreshing after building optional
Work in progress.
This commit is contained in:
parent
bc53d099c3
commit
4e4660f725
2 changed files with 24 additions and 7 deletions
|
@ -344,5 +344,20 @@ public class RefreshScopeTests extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testDefaults() {
|
||||
RefreshScopeManager manager = RefreshScopeManager.getInstance();
|
||||
|
||||
// by default, a project should refresh its root
|
||||
List<IResource> resourcesToRefresh = manager.getResourcesToRefresh(fProject);
|
||||
assertEquals(1, resourcesToRefresh.size());
|
||||
IResource[] resourceArray = resourcesToRefresh.toArray(new IResource[0]);
|
||||
assertEquals(fProject, resourceArray[0]);
|
||||
|
||||
// there should be no exclusions
|
||||
List<RefreshExclusion> exclusions = manager.getExclusions(fProject);
|
||||
assertEquals(0, exclusions.size());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -163,18 +163,20 @@ public class RefreshScopeManager {
|
|||
* These resources might have associated exclusions.
|
||||
*
|
||||
* @param project
|
||||
* @return Set<IResource>
|
||||
* @return List<IResource>
|
||||
*/
|
||||
public List<IResource> getResourcesToRefresh(IProject project) {
|
||||
getProjectToResourcesMap();
|
||||
LinkedHashSet<IResource> resources = fProjectToResourcesMap.get(project);
|
||||
List<IResource> retval;
|
||||
if (resources == null)
|
||||
retval= new LinkedList<IResource>();
|
||||
else
|
||||
retval= new LinkedList<IResource>(resources);
|
||||
|
||||
return retval;
|
||||
if (resources == null) {
|
||||
resources = new LinkedHashSet<IResource>();
|
||||
resources.add(project);
|
||||
fProjectToResourcesMap.put(project, resources);
|
||||
|
||||
}
|
||||
|
||||
return new LinkedList<IResource>(resources);
|
||||
}
|
||||
|
||||
public void setResourcesToRefresh(IProject project, List<IResource> resources) {
|
||||
|
|
Loading…
Add table
Reference in a new issue