Build Multi-platform Projects

You are viewing an old version (v. 4) of this page.
The latest version is v. 18, last edited on Aug 07, 2009 (view differences | )
<< View previous version | view page history | view next version >>

Scenario

Setup build automation for projects that consist of components which need to be compiled or tested on different platforms.

Solution

This can be solved in QuickBuild by running different component build steps on different agents, and transfer files between agents by declaring file requirements for proper steps. We will use a sample to explain the idea. Let's assume that we need to build a project with component1 and component2. component1 needs to be compiled on linux platform with gcc installed, while component2 needs to be compiled on windows platform with visual studio installed. We will came out a step layout like below:

node match condition of each step is designated like below:
  • master: node.isAgent()
    This tells master step to run on a agent node.
  • checkout: node==parent.node
    This tells the checkout step to run on the same agent as the master step.
  • compile component1: (node.getAttribute("os.name").startsWith("Linux") || node.getAttribute("os.name").startsWith("LINUX")) && node.hasAttribute("gcc")
    This tells step compile component1 to run on a linux node with attribute gcc defined. Here the system attribute os.name is used to determine operation system of the node, and gcc is an user attribute which is defined to point to gcc installation path. Refer to [node attributes] on how to examine system attributes and define user attributes for a node.
  • compile component1: node.getAttribute("os.name").startsWith("Windows") && node.hasAttribute("visualstudio")
    This tells step compile component2 to run on a windows node with attribute visualstudio defined. Here the system attribute os.name is used to determine operation system of the node, and visualstudio is an user attribute which is defined to point to visual studio installation path. Refer to [node attributes] on how to examine system attributes and define user attributes for a node.
  • package: node==parent.node
    This tells the package step to run on the same agent as the master step.
  • publish: node==parent.node
    This tells the publish step to run on the same agent as the master step.
File requirements are specified like below:
  • for step compile component1
    Unable to render embedded object: File (file-requirement1.png) not found.
  • for step compile component2
    Unable to render embedded object: File (file-requirement2.png) not found.
  • for step package
    Unable to render embedded object: File (file-requirement3.png) not found.

Here we assume that:

  • component1-src is checked out by step checkout to compile compnent1, and the compilation output is put into directory component1-binary
  • component2-src is checked out by step checkout to compile compnent2, and the compilation output is put into directory component2-binary
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.