PDF Print E-mail

Compass Version 1.3

<< prev
TOC
next >>

Adding a Preprocess Script

Our subversion build plan now checks out code and tries to build it. However, lets say there is a problem with our set up. Let's say that we have a custom build procedure where developers are required to run a python preprocess step before building code occasionally that generates a bunch of C macros based on the version of the software (every time we bump the version number, developers have to rerun this script). To accommodate this custom build procedure, we need to add a Compass build step that runs this custom python script.

Let's say that the script is called 'gen_macros.py' and it is included in the repository in a "scripts" directory under the root directory. It must be called with one argument and that is current the version of the software.

The first thing we need to do is to create a custom script to use in a build step. We can add a new script to Compass on the Script List page, which we get to by clicking on the 'Scripts' tab in the main title bar at the top of the screen. On the scripts list page we click on the 'Create New Script' button which brings up the 'Create New Script' dialog.

All we need to do is fill in this dialog and we'll have our new script. The Dialog looks like this when it first comes up:

 

For our custom script we need do not need to add a 'Script File' but we do need to enter values in the other three inputs on this dialog. First we give our script a name: 'Macro Versioning Preprocess'. For the Command we give: 'python gen_macros.py %(ARG)'. Finally we provide some usage notes in case someone wants to reuse this script for something in the future.

The command that we provided uses the Compass specific syntax '%(ARG)' to denote that this is the place in the command that the build step arguments will be inserted (or where the defaults will be inserted when they are needed). For complex scripts, see the documentation section on creating scripts for more information on the command syntax.

Once we have filled in the four sections on this dialog it looks like this:

After clicking 'Create' the new script will be added to the script list and will be usable from the build editor.

" WHERE id=196
 

bottom
top
Copyright © 2010 Anx Labs. All Rights Reserved.
Anx Labs Inc. - 2251 Double Creek Dr. Ste. 604, Round Rock TX 78664 - 1-888-900-6819
bottom