Friday, April 16, 2010

Use the new Resource Filters in 3.6M7 and JDK 1.7 to simulate snapshots

Suppose you are working in a project in Eclipse, but after updating from your source control server, new files were populated in your workspace that cause some build errors.

How to continue to work in your project without being temporarily distracted by the newly created files?

In Eclipse 3.6, Helios, some new powerful features were added to the Eclipse project management that allows the users to configure exactly what files get to populate a project hierarchy.

By using the new Resource Filter feature (improved in M7), the user can either include only or exclude all files based on a rich set of configurable and extensible filters.

When running on JDK 1.7, another condition is available for filtering, the file creation date.

By creating a resource filter that excludes all files having a creation date newer than a given date, you can prevent those files from even appearing in the workspace, so they not be seen by JDT and generate build errors.

The condition for filtering files and folders are broad, including file name, location, workspace path, last modified, file length, etc... The user can also group those condition in logical prepositions with and, or, and not operators.

3rd party plugins can even contribute new matchers through a core.resources extension point to further extend the filtering ability available to the user (think filtering by CVS status, etc...).

No comments: