title: TFS - build definition with frequently changing branch path
body: <p>My team uses a per-release and per-sprint branching approach. So we typically have a fresh branch off of Main (integration) for the current sprint and a branch off of Main for each release. </p>
  
  <pre><code>Main Branch
  |
   -- Development Folder
  |   |
  |   -- Sprint 2.10_1 Branch
  |   -- Sprint 2.10_2 Branch   *current*
  |
   -- Release Folder
  |   |
  |   -- Release 2.8.0 Branch
  |   -- Release 2.9.0 Branch   *current*
  </code></pre>
  
  <p>There are two build definitions. One points at the current dev branch and the other points at the current release branch.</p>
  
  <p>This setup is working well, except that it has become a bit time-consuming and error-prone to update all the branch paths in the builds every time we branch for a new sprint and branch for a new release. Each build has branch paths in these places:</p>
  
  <ul>
  <li>Source Settings > source control folders (multiple active and cloaked paths)</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/TfnN7.jpg" alt="enter image description here"></p>
  
  <ul>
  <li>Process parameters > Build > projects to build (paths to multiple
  projects)</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/SzQIA.jpg" alt="enter image description here"></p>
  
  <p>A build only ever points to one branch location in tfs, and the only part of that branch path that changes each time is the number associated with the current sprint or release. So for instance a build might switch from pointing from /developement/2.10_1/ to /developement/2.10_2/.</p>
  
  <p>Is there a way to define a base-path once in your build definition and then use it throughout the definition? That way each time we switch branches we only have to specify the branch path in one place? Even better, could that variable's value be managed outside of the build definition so that it could be used by several build definitions? Could the variable value possibly be dynamic based on the active Iteration for the project?</p>
  
  <p>Or can the path entries in the build definition be defined in such a way that they are relative to the branch?</p>
  
  <p>Any suggestions? Thanks!</p>