Search code examples
templatesvisual-studio-2013build-process

BuildTemplate Edits: TFS Community Build Extensions: TFSVersion Build Activity - SourceDirectory problems


I'm trying to follow TFSVersion Build Activity1 to edit my TFS build template.

My default template (and some added activities following the instructions above) for TFS 2013 looks like this: template

I can't get workflow working. Here are the the issues:

  1. I read that SourcesDirectory is in the WellKnownEnvironmentVariables in namespace Microsoft.TeamFoundation.Build.Activities.Extensions. But when i try to use the SourcesDirectory in the "Find the AssemblyInfo File" activity. it tells me it is not declared. i thought you are not supposed to declare it because it's already known? i have the Microsoft.TeamFoundation.Build.Activities referenced. what else do i need?

  2. The instructions say to locate GetWorkspace in your default template. My default template doesn't have that. Do i need to add it under associate changesets? or can i use something from the Initialize Environment activity. But when i look there.. all i see is "src". not ever sure what that is. Do i need to do a GetWorkspace at all if the template uses the Init Env Act?


Solution

  • Follow: SourcesDirectory1

    Yes, apparently you need to use GetEnvironmentVariable activity to get the SourcesDirectory (for TFS 2013). (Save the result in a local variable to be used by the FindMatchingFiles Activity)

    In my case i also needed to use the FULL Path of the SourcesDirectory variable. Since even though i have it listed under the imports, it didn't resolve "WellKnownEnvironmentVariables.SourcesDirectory".

    Microsoft.TeamFoundation.Build.Activities.Extensions.WellKnownEnvironmentVariables.SourcesDirectory

    Also i did NOT need to use GetWorkspace.