views:

80

answers:

3

Hi,

I am using Eclipse for C++ development on windows. I have also written a code generator that take an xml file and produces several C++ files. The project I am working on is currently setup to use the internal builder. What I would like to do is to run the code generator as part of the build process.

My problem is that I haven't been able to find a way to make Eclipse identify that the files are present (or have been updated) without 'Refeshing' the project. So although I can run the code generator as a pre-build step, the files generated aren't guaranteed to be included in the build.

Does anybody know whether there is a way to make Eclipse do a refresh after the pre-build step or something to that effect, using the internal builder?

Thanks

A: 

Although I have not tried this with CDT projects enabling the the Preferences->General->Workspace -> Refresh automatically helps me with Web & Java projects where code generation is involved.

Gorkem Ercan
Thanks for you suggestion Gorkem. I gave it a shot and it didn't work for my setup. It certainly does refresh with that option turned on (rather than having to manually refresh), which is handy, but it doesn't do a refresh while it's building so I still can't run the code generation script as a pre build step and expect the files generated to be built.
Dan
+1  A: 

I'm not sure if this is possible using the internal builder of Eclipse. Refreshing has always been a problem there. But using external build tool, like Maven or Ant, works! I personally would switch to Visual Studio - there you never have such kind of problems

m_pGladiator
+2  A: 

You can add a Builder to your project.

Wouter Lievens
Thanks Wouter, using a builder does pretty much what I wanted.
Dan