Windows CE 6.0 and source control
A question that keeps coming back on the forums and from our customers that just start out with Windows CE is; what files need to be put in source control, and which don't?
To answer this recurring question once and for all; here's a breakdown of all the files and folders that need to be put under version control, specific for Windows CE 6.0 (including R2/R3).
When putting files under source control you:
- Don't want to miss any file that is required for a successful build
- Don't want to add any file that is automatically generated by the build system
- Don't want to add any file that changes automatically every time you build
The last two would cause a new revision every time you build the kernel, which is normally not what you want; a new revision should only indicate changes YOU made.
With those rules in mind, here are the steps:
Windows CE 6.0
First, clean up your BSP folder:
- Delete all obj folders from your BSP (eg C:\WINCE600\PLATFORM\Topaz)
- Delete all build.* files from your BSP
- Remove *.bif your BSP folder
- Remove folders lib and target from your BSP
- Finally remove the folder CESYSGEN\files from your BSP
The easiest way to do this is to search for obj using the search option of the standard Windows File Explorer. Then sort the search results so all obj folders are at the top, select them all (only select the obj folders, do not select any files!) and press the delete key. Once all obj folders are deleted another search for obj should not return anything.
The easiest way to do this is to search for build.* using the search option of the standard Windows File Explorer. Select all build.dat, build.log, build.err & build.wrn files and press the delete key. Once all build.* files are deleted another search for build.* should not return anything.
.bif files are only generated in the root of your BSP (eg C:\WINCE600\PLATFORM\Topaz), so just select the BSP folder in the standard Windows File Explorer and delete any .bif files from there.
These folders contain the libraries (lib) and executables (exe and dll) that result from building your BSP and are generated in the root of your BSP folder (eg C:\WINCE600\PLATFORM\Topaz).
This folder contains the sysgenned files that will be generated every time you sysgen your BSP. Do not delete the CESYSGEN folder itself, just the files subfolder of the CESYSGEN folder needs to be deleted.
You can now add the entire BSP folder to source control.
The next thing to add is any SOC folders your BSP may need to build correctly. In case of the Topaz, we use SOC folders COMMON_TOPAZ_V1 and MX25_TOPAZ_V1 located in \WINCE600\PLATFORM\COMMON\SRC\SOC.
First, clean up these folders:
- Delete all obj folders from any SOC folder your BSP uses (eg C:\WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_TOPAZ_V1)
- Delete all build.* files from any SOC folder your BSP uses
The easiest way to do this is to search for obj using the search option of the standard Windows File Explorer. Then sort the search results so all obj folders are at the top, select them all (only select the obj folders, do not select any files!) and press the delete key. Once all obj folders are deleted another search for obj should not return anything.
The easiest way to do this is to search for build.* using the search option of the standard Windows File Explorer. Select all build.dat, build.log, build.err & build.wrn files and press the delete key. Once all build.* files are deleted another search for build.* should not return anything.
You can now add the SOC folders your BSP uses to source control.
Finally, you need to add your OS Design(s).
Again, first we clean up:
- Remove the .ncb and .suo files from your OS Design root folder (eg C:\WINCE600\OSDesigns\Topaz)
- Remove the .pbxml.user file from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz)
- Remove the RelDir folder (eg C:\WINCE600\OSDesigns\Topaz\RelDir)
- Remove the folder Wince600\cesysgen from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Wince600\cesysgen)
- Remove the folder Wince600\BSP_CPU\sdk from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Wince600\Topaz_ARMV4I\sdk)
- Remove any file in the Wince600 folder
- Remove the folder Wince600\Topaz_ARMV4I\OAK\target and Wince600\Topaz_ARMV4I\OAK\lib from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Wince600\Topaz_ARMV4I\OAK\target)
- Remove any file in the Wince600\OAK folder
- Remove nlscfg.inf in the files folder (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Wince600\Topaz_ARMV4I\OAK\target)
- Remove any folder other than INTLTRNS in the files folder (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Wince600\Topaz_ARMV4I\OAK\target)
- Delete all obj folders from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz)
- Delete all build.* files from your OS Design subfolder (eg C:\WINCE600\OSDesigns\Topaz\Topaz)
- Finally, edit your .sln file in your OS Design root folder (eg C:\WINCE600\OSDesigns\Topaz\Topaz.sln)
- Open the .sln file in Notepad (I recommend Notepad++) and remove all lines in between "GlobalSection(ProjectConfigurationPlatforms) = postSolution"
- Now save the .sln file
These files can be found in the root folder of your OSDesign (eg C:\WINCE600\OSDesigns\Topaz\Topaz.ncb). The .ncb and .suo files are generated by Visual Studio every time you open the OS Design.
This is a file (eg C:\WINCE600\OSDesigns\Topaz\Topaz\Topaz.pbxml.user) generated by Visual Studio every time you open the solution.
This is the folder that will hold all files generated when your build your OS Design build configurations. The entire folder and its subfolders needs to be deleted.
This folder contains the sysgenned files that will be generated every time you sysgen your OS Design. Do not delete the Wince600 folder itself, just the cesysgen subfolder of the Wince600 folder needs to be deleted.
This folder contains the files to be included in the SDK that will be generated every time you build your BSP. Do not delete the Wince600 folder itself, just the sdk subfolder of the Wince600 folder needs to be deleted.
This should just leave one folder named OAK
This folder contains the resulting files from building your subprojects (so if you don't see them you don't have subprojects that generate either a library or an executable. Do not delete the OAK folder itself, just the target and lib subfolders of the Wince600\OAK folder need to be deleted.
This should just leave two folders named files and MISC
This file is regenerated every time you open your OS Design.
INTLTRNS contains the localized string translations. Any other folder will be regenerated.
The easiest way to do this is to search for obj using the search option of the standard Windows File Explorer. Then sort the search results so all obj folders are at the top, select them all (only select the obj folders, do not select any files!) and press the delete key. Once all obj folders are deleted another search for obj should not return anything.
The easiest way to do this is to search for build.* using the search option of the standard Windows File Explorer. Select all build.dat, build.log, build.err & build.wrn files and press the delete key. Once all build.* files are deleted another search for build.* should not return anything.
An annoying bug in the Platform Builder plugin for Visual Studio 2005 is that it generates new GUIDs for the build configurations every time you open the solution file. This would cause a new revision in source control every time you open the OS Design (so without changing any files that would justify a new revision). To work around this bug always keep your .sln file clean:
Now every time you commit your changes to the source control system, double check the changes in the .sln file. Normally nothing else but the GUIDs in between the postSolution section will change, so you can then just revert the changes back to the "clean" file in source control.
You can now add your OS Design to source control.
This concludes the steps required to successfully put all files required for a successful Windows CE 6.0 build under source control.
To build a clean version out of source control perform the following steps:
- Make sure you have committed all your changes
- Remove your BSP folder
- Remove any SOC folder your BSP uses
- Remove the OS Design
- Now checkout all the files from source control into your WINC600 tree
- Open the OS Design solution and immediately close Visual Studio again.
- Right click the OSDesign pbxml (one folder higher), hover over Open Build Window and click on the build configuration you want to build
- In the DOS box, type blddemo -q
When asked to save the solution click No. This action creates the RelDir folder and allows a command line build. You don't save the solution file to prevent the changing GUIDs in the solution file.
NEVER EVER forget -q (as that would be the demonic Build and Sysgen command)!!!
You may want to set the DOS box windows properties to a bigger window and bigger buffer. I usually set the Layout to 150/9999 for buffer size and 150/50 for window size. I also enable QuickEdit mode (on the Options tab).