|
||
|
|
|
Compass Version 1.3
Creating a Regularly Scheduled Perforce Build PlanThis is the first part of a three part article on creating a perforce build plan. For this series of articles, we assume that we already have the following:
The first step in setting up the build plan is to navigate to the build editor page, by first accessing the project details page of the 'Perforce Example' project and then clicking 'Create Build' button. This will ask us for the name of the project and the files we want to save with every execution of the build plan. We will call our new build plan 'Example Build Plan' and since we don't know if we want anything saved with each build yet, we will leave the 'Save File or Dir' box empty. After hitting 'OK' we are taken to the build editor page which looks like this:
The first thing we need to do is to add a build step to check out our project from the perforce repository. We click the 'Add Script' button and an empty build step is added to the build plan:
Now we fill in the Name, select 'Perforce Argument Checkout' from the scripts drop down box. The Perforce Argument Checkout script requires us to put the perforce URL and the depot as arguments so we add 'perforce:1666 //depot/trunk/... as arguments and now our build step looks like this:
If we were to run our build plan now it would check out code from the repository and that's it. We need to add a build step to build our source code to make sure it builds correctly. Click the 'Add Script' Button again and fill in the second build step to use the Visual Studio Rebuild script to build a visual studio project named 'example_code.' After adding this build step our build plan looks like this: We are not quite done with adding the Build step. When we look at the usage_notes for Visual Studio Rebuild (which can be seen by clicking the '...' button) it says that we also much set the CONFIG_NAME argument to be the name of the visual studio configuration that we need to build. To do this, we click on the defaults button and enter the CONFIG_NAME in the script defaults dialog like this:
We always want to test the Release configuration in visual studio so that is the value we use. After clicking 'OK' we are done setting up the build steps in our build plan. We just need to set the build configuration variables and then save our build plan. Since we are only using windows for our build environment, we want to turn off linux build configurations. Also, our example_code project, builds an executable called example_code and puts it in the bin/ directory. So we need to add this to the 'Save file or Dir' textbox. After doing this the build configuration looks like this:
The only thing left to do, is to schedule our build. To do this we click on the 'Schedule Build' button in the Scheduled Builds section. On the Date/Time tab, we schedule our build to execute on March 2, 2009 at 8:00am and then every 3 hours from then on. After setting this recurrence, the Schedule Build dialog looks like this:
After clicking 'OK' we are done setting up and scheduling our build plan. The build editor page now looks like this:
|











