I have a pre-build event on a C# project which runs xsltproc to transform some XML into C# source files. The generated source then gets built in the normal way. This means that the project always gets built regardless of whether the XML has changed.
Is there a way of only generating the C# classes if the XML has changed? Is a pre-build event the wrong approach? Would I be better off with a custom tool of some kind to turn the XML into C#?
I'm using Visual Studio 2010. The XML doesn't contain serialized objects.
Any help much appreciated.