property evaluation order (beta 3)

Why is the following not working? I tried moving the Import of the Microsoft.TeamFoundation.Build.targets from the top of the build file to the bottom, but it had no affect. Our environment has separate TFS and Build servers. I'm using TFSBuild.exe to kick off the build through a batch file. This article describeshttp://msdn2.microsoft.com/en-us/library/ms171464.aspx the order of evaluation but it isn't working. I also tried moving the RootProjectFolder property to a a new <PropertyGroup /> element. The affect is that only the first <PropertyGroup /> element is evaluated before the build is "kicked" off. An initial round of evaluation of the build file appears to be occuring on the TFS but this evaluation does is not a full evaluation.

<PropertyGroup>

...

<RootProjectFolder>ProjectX</RootProjectFolder>

<DropLocation>\\9nytp71.aus.amer.dell.com\BuildOutput\$(RootProjectFolder)</DropLocation>

...

</PropertyGroup>

The error is:

Failed to connect to drop location\\9nytp71.aus.amer.dell.com\BuildOutput\$(RootProjectFolder). Ensure that this is a valid share

[2327 byte] By [JoeyBradshaw] at [2008-2-16]
# 1

There appears to be nothing wrong with this from the MSBuild point of view - yes, RootProjectFolder should have been evaluated in DropLocation. Maybe the TFS folks can shine some light on this.

thanks,

Lukasz

LukaszGwozdz at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 2

I just tried this on my machine, and it behaves in the same manner. I'm using the December CTP of TFS. It seems like Team build is not using the msbuild object model to get those evaluated properties, but instead are simply extracting the text value from those property declarations.

I tried to overwirte it in different places in the project file as well, with no luck. It always took the first declaration. I'm guessing that the property is not able to be overwritten because it is passed in as a command line parameter to msbuild.exe by team build. But there is a workaround that solves some of the issues. In your TFSBuild.proj file, modify the DropLocation to one that doesn't use any properties and insert the following towards the bottom:

<PropertyGroup>

<RootProjectFolder>ProjectX</RootProjectFolder>

<DropBuildDependsOn>

FixDropLocation;

$(DropBuildDependsOn);

</DropBuildDependsOn>

</PropertyGroup>

<Target Name="FixDropLocation">

<CreateProperty Value="$(DropLocation)\$(RootProjectFolder)">

<Output TaskParameter="Value" PropertyName="DropLocation"/>

</CreateProperty>

<Message Text="Drop loc: $(DropLocation)" Importance="high"/>

</Target>

This prepends the FixDropLocation to the DropBuildDependsOn list of targets, so it will be executed before the DropBuild target. This cause your project drop files to be dropped in the location tat you want. This is able to overwrite the DropLocation property becuase we are using the CreateProperty task to overwrite this instead of the normal property declaration.

This is not however a perfect solution, because your build log will always be located in the DropLocation that was originally declared (the one w/o the property embedded within it). And in the Team build type history the drop location will also have this location as well. But it does place the files where you want them :)

Unfortunately it looks like the DropLocation that is given to TFS is happening outside the scope of MSBuild so I'm not sure you have a lot of options. You can't even pass this as a command line parameter to the tfsbuild.exe utility either. Let me know if this is not clear.

Hope this helps,

Sayed Ibrahim Hashimi
www.sedodream.com

SayedIbrahimHashimi at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 3

This is not an MSBuild issue.

Team Build reads the property value before calling MSBuild (outside MSBuild process) to ensure DropLocation exists. The error is coming from there.

There is no workaround other than not using properties inside DropLocation node.

Thanks,

Gautam

GautamGoenka at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 4

Hi Folks,

I am also trying to do something similar.

I currently use the incremented version number (ie 1.3.0.2345) in the following manner:

    • label my source code
    • update assemblyinfo.cs, files
    • as the $(projectName) \$(versionNumber) drop location

In using TFSBuild.exe I cannot change the Build Name or the Drop Location at any point in the tfsbuild.proj file.

The build log only reflects what TFSBuild.exe forces upon the user:

Target InitializeEndToEndIteration:
UpdateBuildNumberDropLocation BuildNumber='Auto_20060410.9' DropLocation='\\TFSBUILD\Share\Auto_20060410.9' .

Is there (or will there be) a way to change/ignore this behaviour through parameters to TFSBuild.exe?

A second issue ...

Why does the GET grab everything from the project directory on down, including the BuildTypes subdirectory structure? Is there a way to "cherry-pick" the directories we want to use?

MSBuild offers the flexability to do all of these and TFSBuild removes this flexability. Is there a way to update the TFSBuild reporting summary without using TFSBuild?

Regards,

Sean

SeanPerkin at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 5

1) how to customize the drop location?

Steps -

a) Edit your build type definition (tfsbuild.proj) file and overload the BeforeEndToEndIteration

<Target Name="BeforeEndToEndIteration">

<CreateProperty Value="$(CustomDropLocation)" >

<Output TaskParameter="Value" PropertyName="DropLocation"/>

</CreateProperty>

</Target>

b) Edit the tfsbuild.rsp file to pass the custom value of drop location. For eaxmple in your tfsbuild.proj, the value of DropLocation is \\machine\drop1 and you want to change it to \\machine\drop2. Add the following line to tfsbuild.rsp. This along with changes in step (a) will reset your DropLocation.

/p:CustomDropLocation=\\machine\drops2

2) is there a way to "cherry-pick" folders in tfsbuild?

We have workspacemapping.xml file to allow you to customize the folders you want to sync. Please refer the following blog post for more details

http://blogs.msdn.com/manishagarwal/archive/2005/10/13/480584.aspx

For more details about the overriding precedence for msbuild properties, refer the post

http://blogs.msdn.com/manishagarwal/archive/2006/03/02/541934.aspx

Regards

ManishAgarwal at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 6

Thanks Manish. That helped.

I currently use the incremented version number (ie 1.3.0.2345) in the following manner:

    • label my source code
    • update assemblyinfo.cs, files
    • as the $(projectName) \$(versionNumber) drop location

In using TFSBuild.exe I cannot change the Build Name any point in the tfsbuild.proj file

Is it possible to change the build name to be the same as the version number?

Is there a way to update the TFSBuild reporting summary without using TFSBuild?

Regards,

Sean

SeanPerkin at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 7

Sean,

1) I am not clear on what you mean by Build Name. In team build, the builds are identified as build number. It is very easy to have your own custom build number. Please refer to this old blog post for more details - http://blogs.msdn.com/manishagarwal/archive/2005/07/13/438077.aspx

2) Again, your build number (build name) can be anything as long as it is unique

3) I will ask Amit from my team to respond to this question.

ManishAgarwal at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...
# 8

Sean,

Can you give some more details on what kind of fields or information that are looking to update in the Team Build Report?

Thanks,
Amit

AmitChattopadhyay at 2007-9-9 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Build Automation...

Visual Studio Team System

Site Classified