I have created a CodeActivity for use in (custom) build definitions. This activity needs to copy files located on the server to/from places like the 'source directory', 'custom folders' to the 'drop directory' (etc.) before executing its primary purpose.
Some of the variables I have are valid paths, but others are obviously placeholders for 'relative paths'. However, I need the physical server path so I can copy useful items to-and-fro.
I NEED THINGS LIKE:
- The physical path for the projects root (see image below)
- To be able to resolve the physical path to custom folders (see image below)
- It would be nice to be able to resolve physical paths from 'relative paths'
Of course, I could pass the project-name into the activity (for parsing purposes)...because that would just be 'cheesy'.
MY QUESTION(S) ARE:
- How do I resolve the physical path to the TFS project root?
- Once I resolve the root, can I rely on it to 'build' paths to custom folders?
- How do I get the server paths from relative paths like '$/Test/Drops'?
SOME EXAMPLES OF THINGS I KNOW HOW TO GET:
These items are somewhat useful, while others...not so much. Unless, I can use them to get the physical server paths.
BuildDirectory:
'F:ldBuilds41TestTest_CustomActivity_CreateNuGetPackages'
BuildDetail.DropLocationRoot:
'$/Test/Drops'
...wish I had the physical path
BuildDetail.BuildController.CustomAssemblyPath:
'$/Test/BuildProcessTemplates'
...wish I had the physical path
SourcesDirectory:
'F:ldBuilds41TestTest_CustomActivity_CreateNuGetPackagessrc'
Workspace.Folders:
'F:ldBuilds41TestTest_CustomActivity_CreateNuGetPackagessrcTestNuGet.Research
et35'
SOME EXAMPLES OF THINGS I WANT:
UPDATE: 2/2/2015
@Edward - per your request. Below is a more detailed explanation of what I am trying to accomplish.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…