Eclipse’s help documents the .project file as the “project description
file”. Its page covers the elements up to linked resources; the later ones (triggers,
filters, variables, snapshot location) are taken here from the Eclipse Platform code
that reads the file. All values are element text; there are no attributes.
Elements
Inside the projectDescription root; the help page’s DTD gives the order
of the first six, and the reader accepts the last three after them:
| Element | Contains | Meaning |
|---|---|---|
name | text | The project name. Ignored if it differs from the name of the project using the description. |
comment | text | Free text, not interpreted. |
projects | project* | Referenced projects, each by name. |
buildSpec | buildCommand* | The builders, in the order they run (below). |
natures | nature* | Nature IDs, e.g. org.eclipse.jdt.core.javanature. |
linkedResources | link* | Files and folders stored outside the project folder (below). |
filteredResources | filter* | Resource filters (below). |
variableList | variable* | Path variables defined for the project: each has name and value; one with an empty name is skipped. |
snapshotLocation | text | A URI for a project snapshot. |
Build commands
| Element | Meaning |
|---|---|
name | The builder’s ID, e.g. org.eclipse.jdt.core.javabuilder. |
triggers | When the builder runs: a comma-separated list (no spaces) of auto, full, incremental and clean, matched without regard to case. Its presence marks the builder as configurable; unknown words are ignored. |
arguments | Optional arguments: dictionary elements, each with a key and a value. |
Linked resources
| Element | Meaning |
|---|---|
name | The path of the linked resource within the project. |
type | 1 a file, 2 a folder. |
location | Target in the local file system: an absolute path, or a relative path whose first segment is a path variable. |
locationURI | Target as a URI, for resources in other file systems; used instead of location. |
A link without a location, or with an empty name, is dropped when read.
Resource filters
| Element | Meaning |
|---|---|
id | A number identifying the filter. |
name | The project-relative path of the folder it applies to (empty for the project itself). |
type | Flags added together (below). |
matcher | An id naming the matcher and its arguments: plain text, or nested matcher elements for matchers that combine others. |
Filter type flags
| Value | Name | Meaning |
|---|---|---|
| 1 | INCLUDE_ONLY | Only resources matching the filter are included. |
| 2 | EXCLUDE_ALL | Resources matching the filter are excluded. |
| 4 | FILES | Applies to files. |
| 8 | FOLDERS | Applies to folders. |
| 16 | INHERITABLE | Applies to the folder’s sub-folders as well. |
For example, type 10 (2 + 8) excludes matching folders; 26 also applies
to sub-folders.
Sources
Eclipse help, The
project description file (elements to linkedResources, link types).
Eclipse Platform source, org.eclipse.core.resources:
IModelObjectConstants.java (element names and trigger words),
ProjectDescriptionReader.java (triggers, filters, matchers, variables,
snapshot location, link handling) and IResourceFilterDescription.java
(filter type flags). Matcher IDs (supplied by plugins) are not listed.