views:

90

answers:

2

I am working on an SDK that is targeting both the Full/Desktop .Net Framework and the Compact .Net Framework. As such I have a solution that has projects for the Compact Framework and the full framework. The project files contain the same source files, or thay should. Some of the developers that are working on this SDK with me are only working on the full framework side. From time to time they add a file to the full framework projects, but forget to add it to the compact framework project. Eventually some other peice of code (already in both projects) references this new type. Then the build fails that evening because the compact framework project does not include the new file. Does anyone know of a tool or trick to verify that two project files are in sync? Remember that the files are not identical (one is for the compact framework and the other for the full framework).

BTW, before you mention it I have read The Moths blog posts on this.

Pat O

+5  A: 

Yes, there is a trick ;-p Consider this line from my protobuf-net CF project file:

<ItemGroup>
    <Compile Include="..\protobuf-net\**\*.cs" />
</ItemGroup>

It says "in this project, include and compile all the .cs files from (back a level, up to the sibling protobuf-net folder) and all sub-folders".

Marc Gravell
That is genius on so many level. 45k well deserved.
Jonathan C Dickinson
Cool trick. Not really what I was looking for though. I guess I need to think about it some more.
Pat O
Clever, but it assume that I want all of the files in both.
Pat O
You can also #if the ones you don't want...
Marc Gravell
I can but it "smells bad" to me to #if an entire file see http://c2.com/cgi/wiki?CodeSmell for a description of code smelling bad.
Pat O
Then add an Exclude into the above instead...
Marc Gravell
+1  A: 

Sounds like you already have continuous integration going on, that is really step one in this -- making sure all the developers know about the build breaking as soon as possible.

If you don't, please check out JetBrains Team City, Cruise Control, or Microsoft Team Systems Team Build.

Depending on your source control server, you might be able to setup check-in policies as well. So if a particular file is checked in, and alert is generated.

But typically I share as much code as I can through linked files. If you have to have different code between the two, hopefully subtle differences, you can do #IFDEFs around the differing code.

Sorry, but no easy answers on this one.

Chris Brandsma
I expected as much, but you can understand my need to ask the question.
Pat O