1

When I create a build definition I have setup some source settings, example below:

enter image description here

Problem is I want it to trigger a build when someone checks into the Builds or Install folders, but the Includes folder is just some libraries and other items it needs. I don't want it to re-run when these libraries are changed. However I need to set them up here to make sure they are copied across to the Build drop server. Is there a way to copy across this Includes folder without forcing a build trigger when someone checks in to this folder?

User101
  • 748
  • 2
  • 10
  • 29
  • 1
    If the /Includes/ folder is just third-party references, why not make them into NuGet packages and reference them from the projects that need them? – Daniel Mann Feb 23 '15 at 22:54

3 Answers3

1

There is no easy way to do this. As you've discovered, the source settings do double-duty, they define the set of files needed for the build that are downloaded and the set of files that trigger a CI.

I would argue this isn't a problem, if the Includes are used in your build, then I would want to kick off a new build when they change, to ensure that the change didn't break anything in the build process.

Dylan Smith
  • 22,069
  • 2
  • 47
  • 62
  • A fair point and in most cases I would expect this to be the case too. The problem is in my particular case the Includes are used for another project and this project, but this project uses a third party dll that will almost never change. But all dlls need to be kept in this Include folder. – User101 Feb 23 '15 at 16:31
  • You can use more specific paths in your source settings then. Don't map the whole includes folder, instead just map the folders your build uses/needs. – Dylan Smith Feb 23 '15 at 16:37
1

Use the special keyword ***_NO_CI*** in your checkin into the Includes directory.

See this post for further details.

Community
  • 1
  • 1
d3r3kk
  • 3,465
  • 3
  • 18
  • 22
1

There are 2 things to do to approach this.

First you need to get your source folders into a build centric layout, this will help to eliminate as much overlapping as possible.

If you need a particular shared folder that shouldn't trigger a build, then don't include it in the source mappings, instead add a script to download the files to your workspace as an early part of the build.

The example will need updating for your visual studio version, and you should pass the sources Directory to the script.

   REM %1 represents the Sources directory
   REM Compute variables
   SET TfExe="%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe"
   REM SET TfExe="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TF.exe"
   Set RefPath="$/TFS BUILDS/Shapes/Main/Includes"
   Set localPath="%~1\Includes"

   REM set the Drive Letter for this build
   Set Localdrive=%localPath:~1,2%
   %Localdrive%
   cd %1

   REM Map the folders 
   %TfExe% workfold /map %RefPath% %localPath%

   REM Get the required content
   %TfExe% get %RefPath%

   REM Unmap the folders 
   %TfExe% workfold /unmap %RefPath%
Just TFS
  • 4,697
  • 1
  • 18
  • 22