How to get BuildNumber in .proj (MSBuild) using TFS server

前端 未结 1 1525
别跟我提以往
别跟我提以往 2020-12-10 17:38

We use TFS 2010 with VS 2010 for PHP web projects. Actually we do not have any .proj or .sln file, so i have made my own to make builds, it looks like this:

         


        
相关标签:
1条回答
  • 2020-12-10 18:07

    To run AfterBuild targets:

    <DefaultTargets="AfterBuild" />
    
    <Target Name="Build" DependsOnTargets="Zip">
    
    <Target Name="AfterBuild" DependsOnTargets="Build">
    

    For me is not clear why Zip target should be executed before the Build target?

    EDIT:

    You have to update template file defaultTemplate.XAML by adding manually BuildNumber to the MSBuild command line so command Line would be like:

    <mtbwa:MSBuild CommandLineArguments="[String.Format(&quot;
            /p:SkipInvalidConfigurations=true 
            /p:BuildNumber={1} {0}&quot;, 
            MSBuildArguments, 
            BuildDetail.BuildNumber)]" />
    

    See the original article regarding this trick: TFS2010 – Where is $(BuildNumber)?

    0 讨论(0)
提交回复
热议问题