<getCSourcepath> (experimental)
Note: Tasks tagged as experimental are considered to be unstable. They may change in the future.
Description
The getCSourcepath task resolves the source folders of an Eclipse C/C++ project.
The source folders can be resolved to Ant's
Path-type or to a string property. The path can be resolved in a
relative (to the given workspace) or absolute manner. Additionally this task
allows to filter include pathes in case they are a part of the source pathes.
In fact there are two Ant4Eclipse tasks that can perform this operation for you: getSourcepath and getCSourcepath . As the task getSourcepath is also used in conjunction with Java projects it allows to retrieve the source path in a more or less general way. This might work in your project but sometimes the Include path is part of the source path, too. There might be reasons to suppress this Include path. This is the point where the language specific variety getCSourcepath becomes useful.
Arguments
Note: You can specify either the path to the project (using the
project argument) or you can specify the path to the workspace (
workspace argument) and the name of the project (
projectName argument).
| Argument | Description | Required |
|---|---|---|
| project | Path to the project for which the output path should be build | either the project or the combination of workspace and projectName has to be specified |
| workspace | Path to the workspace containing the projects | |
| projectName | Name of the project inside of the workspace for which the output path should be build | |
| initialiseWorkspace | Set to 'true' if your workspace contains projects which have project names that differ from the names of their project folders and the workspace doesn't contain a .metadata directory. | no (default: false) |
| pathId | The reference id for the path that will be created | either the pathId or the property has to be specified |
| property | The name of the property that will hold the resolved path | either the pathId or the property has to be specified |
| relative | Determines whether the resolved path should contain relative paths (to the given workspace) or absolute paths | no (default: false) |
| pathSeparator | The pathSeparator string is used to separate the filenames in the property | no (default: on UNIX systems, this character is
':'; on Microsoft Windows systems it is
';'.) |
| allowMultipleFolders | Must set to
true to allow multiple source folders. If
allowMultipleFolders is
false and the result contains multiple folders, an
BuildException is thrown. |
no (default:
false) |
| noIncludes | Must set to
true to filter include folders from the source
path. |
no (default:
false) |
| variablesRef | The ID of an ant property set. This property set will be used to resolve Eclipse variables. This allows to prefer a specific set of properties rather than using the ant properties in general. | no |
Example
The following example shows how to retrieves the source path while suppressing the include path:
See also: getSourcepath