Running the ARM Build with Ant
The beauty of this trick is that it does not change how you invoke Ant; once you write and debug the transformation, you need only include it in your Ant build script. The one we used is shown in
Listing 3.
The Ant build script begins by defining the target name and properties for the target name, such as the input vcproj (set as the Ant property SlideShow.vcproj.file) along with the input and output directory. The magic comes with the line:
<xslt
in="${SlideShow.vcproj.file}"
out="${SlideShow.vcproj.dir}/SlideShow-armcc.xml"
style="vcproj2ant_2.xsl"/>
This invokes Ant's XSL processor, converting the input vcproj
SlideShow.vcproj to the resulting file
SlideShow-armcc.xml using the style sheet
vcproj2ant_2.xsl, shown in
Listing 2.
After performing the transformation, the Ant script in Listing 3 outputs the base directory, project directory, and output directory file and name, and then invokes itself using the newly created Ant script SlideShow-armcc.xml. You can see the Ant-created result of the transformation in Listing 4.
Running this script with Ant produces a full buildindividual object files linked into the target elf and then converted to a BREW module, as you see in Listing 5.
Conclusion
The strategy presented here is applicable for any XML-based build environment, because it's always possible to use XSL to convert from one XML vocabulary to another. The method can apply not just to file management in a software product, but to all aspects of build configuration management supported by Microsoft Developer Studio (including multiple targets based on compile-time options, different tool chain choices, and the like) given a sufficient investment in the transformation document.