0
votes

So, we are in this process of migrating XAML Builds to vNext (2015) Builds on TFS, and we are trying to "do things as clean as possible", since we had many, many customizations on the XAML builds that could be avoided and actually gave us problems along the way.

One major issue we are facing is with paths and "global files". Let me explain:

There are some files that, for commodity reasons, we have on a single place and every SLN file on that Collection refers them. Those files are such ones as Code Analysis RuleSets, Signing Files (SNK), etc. So the change is made in one place only and it affects every build.

Well, in XAML Builds we have a Build that runs with CI that downloads (Gets) those files, and since we hammered-in the same exact pathing for TFS and Machine (with a environment variable for the beginning of the path), the path is the same on the Developers and Build machines. However, this creates dependencies between builds and workspace issues.

My question here is, is there a configuration that I am missing that allows referring to files in other branches other than the build one? Since I’m trying to keep the build machines as “disposable” as possible, it’s running with an Agent Config Out of the Box: No custom paths, no hardwiring.

I already tried referring the files directly with their source control path, for example. The only options I’m seeing are either creating a PowerShell/CMD Script that downloads those files right into the same folder as the SLN or keeping it “as it is” and use relative paths putting a “Build” Build Step before the actual Build Step so it downloads the files to the server.

Isn’t there an “Elegant” way of doing this? Or is our methodology wrong from the get go?

1
Have you tried setting up explicit mappings for these files? e.g. $/Project/common/ruleset.ruleset => $(SourceDir)\Common\ruleset.ruleset Sticking them in a NuGet would also do the trick/. Or set a variable in the build definition, it will be stored as a environment variable on the buil agent at runtime.jessehouwing

1 Answers

0
votes

You can add a Copy Files step to copy the files that the build needs:

enter image description here