|API to attach header files to a C project in Eclipse CDT [message #910649]
||Mon, 10 September 2012 06:45
| sangram reddy
Registered: September 2012
We made an Eclipse CDT plugin in order to create a C project layout that follow certain standard set across our organization. We maintain some sort of XML files that define the project/product dependencies. That means, every product will have an XML file that defines what source files/headers goes into that product.|
So, when importing a C project in Eclipse CDT, instead of following the standard CDT project setup, our plugin takes product name as the input and parses the product's XML to generate a C project with appropriate source files.
We were able to attach source files to the C project using the following API and Linked Resources concept in Eclipse.
We were also able to attach header files to the same C project using the following class.
Note: We created IIncludeEntry instances with the inlcude directories as the input. Eclipse's scanner discovery mechanism is identifying the individual source files inside each directory and showing them under "Includes" tag in C project.
Now the source files are shown under "Source" tag and the header files are shown under "Includes" tag in the C project. We could modify and build the source files without any issues.
However, we couldn't edit any of the header files. If I manually add an external header file thru Project >> Properties >> C/C++ General >> Paths and Symbols everything works fine, we can edit the files.
I also tried to use org.eclipse.cdt.core.model.IIncludeFileEntry instead of IIncludeEntry by giving individual header file paths to IIncludeFileEntry. But Eclipse isn't identifying anything with IIncludeFileEntry.
What's the CDT API to create/attach header files to a C project? How Eclipse CDT creates them?
Powered by FUDForum
. Page generated in 0.01653 seconds