问题
TFS 2013 using the DefaultTemplate11.1.xaml. Inside the BeforeCompile Target.
I'm trying to copy files in my .proj file to the droplocation but the variable, $(TF_BUILD_DROPLOCATION) does not seem to work.
I've tried evaluation it from inside the .proj but it with $(TF_BUILD_DROPLOCATION) but it evaluated to empty. I've tried passing it in as a parameter from the msbuild arguments with DropLocation=$(TF_BUILD_DROPLOCATION); but it doesnt evaluate and appears in the script as $(TF_BUILD_DROPLOCATION).
The drop location should be our share with the build number appended.
回答1:
I don't think it is possible to use the TF_BUILD_DROPLOCATION variable in the .proj file.
For your requirement to copy files to TFS build drop location, here are some options:
- Just as Dave mentioned above, you can first use Copy task to copy files to one specific folder, then customize the TFS build process template via adding the CopyDirectory build activity to copy contents in source folder to destination folder. You can set the Destination to be: Microsoft.TeamFoundation.Build.Activities.Extensions.WellKnownEnvironmentVariables.DropLocation
- Customize your build process template via adding InvokeProcess activity to call xcopy command to copy files. Please check Ewald's blog. (The blog was written for TFS2010, it applies to TFS2013 as well)
回答2:
I should have been more specific. We're working with VSO, hence the process can not be edited. So the answer is no, the drop location is not available.
I've had to construct the droplocation myself using $(MyDropLocationRootParam)\$(BuildDefinition)\$(BuildNumber)
来源:https://stackoverflow.com/questions/31811617/where-is-the-droplocation-variable-in-tfs-build-2013