ne of the challenges of cross-platform development is managing your build environment. With so many platforms these days using the combination of Microsoft Visual Studio and an emulator to facilitate rapid development and frequent cross-compilation using a separate build chain, you may frequently find your emulation and target build environments don't have the same file lists or dependencies. This is because you have to update both
the Microsoft Visual Studio environment and the target hardware environment using something like a make file or an Ant script. The repercussions of this process are obvious: bizarre run-time problems or broken builds that result in the gnashing of teeth for everyone on the development team.
Tired of this pain in our organization and fresh from switching from Microsoft to Ant to automate builds, we decided to use Ant's built-in XSL processor to convert from Microsoft's XML vocabulary to Ant's XML vocabulary on-the-fly as part of a pre-build step. This eliminates the need for file dependency lists for the target platform entirely. In essence, this delegates the responsibility for maintaining the build dependencies to Microsoft Visual Studio alone, giving the development team a single place in which to add or remove files. This article shows you how to do this for the Slideshow application in the QUALCOMM BREW development book Software Development for the QUALCOMM BREW Platform You can download the source code here. Remember that the same strategy can be used for any remote target environment if you're leveraging Ant for your device builds
Understanding the Vocabulary of a Microsoft Developer Studio Project File
With the advent of Microsoft Visual Studio C++ for .NET (the seventh major release of Microsoft Visual Studio), the tool chain now stores project files as XML documents, making it easy for developers to manage and process build dependencies. Listing 1 shows a typical .vcproj project file.
Most of the tags are self-explanatory. Each build configuration (release, debug, or custom configurations) is contained within the <Configurations> tag; this tag specifies both the tools used to build a specific configuration, as well as build options (include paths and compile-time definitions) and the target directory. There's also the <Files> tag, which contains a list of files grouped in the project in <Filter> tags, reflecting the organization of the vcproj in Microsoft Visual Studio's Solution Explorer. Within the <Files> tag someplacedepending on the organization of your Solution Explorer windoware <File> tags, one for each of the files that comprise your project.