Windows Embedded Compact 7 and source control
A question that keeps coming back on the forums and from our customers that just start out with Windows Embedded Compact 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 EC 7.
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 Embedded Compact 7
First, clean up your BSP folder:
- Delete all obj folders from your BSP (eg C:\WINCE700\PLATFORM\Opal)
- Delete all build.* files from your BSP
- Delete all bldsys.* 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 and build.wrn files and press the delete key. Once all build.* files are deleted another search for build.* should not return anything.
The easiest way to do this is to search for bldsys.* using the search option of the standard Windows File Explorer. Select all bldsys.log, bldsys.out, bldsys.err and bldsys.wrn files and press the delete key. Once all bldsys.* files are deleted another search for bldsys.* should not return anything.
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 Opal, we use SOC folders COMMON_FSL_V3 and MX53_FSL_V3 located in \WINCE700\PLATFORM\COMMON\SRC\SOC.
First, clean up these folders:
- Delete all obj folders from any SOC folder your BSP uses (eg C:\WINCE700\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V3)
- Delete all build.* files from any SOC folder your BSP uses
- Delete all bldsys.* 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.
The easiest way to do this is to search for bldsys.* using the search option of the standard Windows File Explorer. Select all bldsys.log, bldsys.out, bldsys.err and bldsys.wrn files and press the delete key. Once all bldsys.* files are deleted another search for bldsys.* 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:\WINCE700\OSDesigns\Opal)
- Remove the .pbxml.user file from your OS Design subfolder (eg C:\WINCE700\OSDesigns\Opal\Opal)
- Remove the RelDir folder (eg C:\WINCE700\OSDesigns\Opal\RelDir)
- Remove the folder Wince700 from your OS Design subfolder (eg C:\WINCE700\OSDesigns\Opal\Opal\Wince700
- Delete all obj folders from your OS Design subfolder (eg C:\WINCE700\OSDesigns\Opal\Opal)
- Delete all build.* files from your OS Design subfolder (eg C:\WINCE700\OSDesigns\Opal\Opal)
These files can be found in the root folder of your OSDesign (eg C:\WINCE700\OSDesigns\Opal\Opal.ncb). The .ncb and .suo files are generated by Visual Studio every time you open the OS Design.
This is a file (eg C:\WINCE700\OSDesigns\Opal\Opal\Opal.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. The entire folder and its subfolders needs to be deleted.
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 your OS Design to source control.
This concludes the steps required to successfully put all files required for a successful Windows Embedded Compact 7 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 WINC700 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
This action creates the RelDir folder and allows a command line build.
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).