RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Cross-platform Builds Made Easy: From Microsoft Visual Studio to ARMCC Using Ant and XSL : Page 3

Tired of keeping embedded make files in sync with your Microsoft Visual Studio project? Use Ant's XSL processor to convert Microsoft Visual Studio project files on-the-fly before cross-platform builds!

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:

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 build—individual object files linked into the target elf and then converted to a BREW module, as you see in Listing 5.

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.

Ray Rischpater is the chief architect at Rocket Mobile, Inc., specializing in the design and development of messaging and information access applications for today's wireless devices. Ray is the author of several books on software development including "eBay Application Development" and "Software Development for the QUALCOMM BREW Platform," both available from Apress, and is an active amateur radio operator.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date