Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS get name of build directory inside of CodeActivity

I am creating a TFS2013 custom activity using the CodeActivity base class.

Here is the overload I am working with...

    protected override void Execute(CodeActivityContext context)

With a CodeActivityContext, how does one get the build directory (where the files get dropped before being built by MSBuild)? I need to modify a file in the build directory path prior to MSBuild taking over.

like image 812
John Livermore Avatar asked Feb 11 '23 21:02

John Livermore


1 Answers

You can pass in a string to your activity

[RequiredArgument]
        public InArgument<string> DirectoryToSearch { get; set; }

In previous versions of TFS you could just Pass in SourcesDirectory or BinariesDirectory

In 2013 the default objects for SourcesDirectory and BinariesDirectory have been withdrawn.

you can now get these from the

Microsoft.TeamFoundation.Build.Activities.Extensions.WellKnownEnvironmentVariables object.

WellKnownEnvironmentVariables

like image 157
Just TFS Avatar answered Apr 29 '23 03:04

Just TFS