Customise Build Build Output for Specific Projects

前端 未结 2 1735
滥情空心
滥情空心 2020-12-07 05:11

I have a solution which contains a number of 2 windows console projects, 1 website project and 20 class libraries.

I want TFS 2013 to push to the drop folder only t

相关标签:
2条回答
  • 2020-12-07 05:44
    • The default template has Solution Specific Build Outputs property under Process tab Advanced section. Solution Specific Build Outputs

    • Alternatively you can let MSBuild control your build flow.

    Update:

    • The ultimate solution seems implementing NuGet's PublishedApplications
    0 讨论(0)
  • 2020-12-07 06:05

    I've used PublishedApplications NuGet package as well, but have encountered an issue. If referenced libraries had Content marked as Copy Always all content would be copied to the root folder and not hierarchically. For example if you have following projects and structure (some files omitted for brevity):

    PublishLib
        test
            TextFile1.txt (marked as Content/CopyAlways)
    
    TestPublishTargetApp - references PublishLib
        targets
            Microsoft.Application.targets
    

    When team build is done this is the content of _PublishedApplications\TestPublishTargetApp folder:

    PublishLib.dll
    TestPublishTargetApp.exe
    TestPublishTargetApp.exe.config
    TestPublishTargetApp.pdb
    TextFile1.txt
    

    And what I expected was:

    test\TextFile1.txt
    PublishLib.dll
    TestPublishTargetApp.exe
    TestPublishTargetApp.exe.config
    TestPublishTargetApp.pdb
    

    After fiddling around a bit with Microsoft.Application.targets I was able to get what I wanted by changing last <Copy SourceFiles (original commented out):

        <!--<Copy SourceFiles="@(_SourceItemsToCopyToOutputDirectoryAlways)"
          DestinationFolder="$(ExeProjectOutputDir)"
          SkipUnchangedFiles="false"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"/>-->
    
        <Copy SourceFiles="@(_SourceItemsToCopyToOutputDirectoryAlways)"
          DestinationFiles = "@(_SourceItemsToCopyToOutputDirectoryAlways->'$(ExeProjectOutputDir)\%(TargetPath)')"
          SkipUnchangedFiles="false"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"/>
    

    I am not sure if this is useful to anyone else, but for me this was essential change, plus PublishedApplications NuGet package was not changed since 2014 (seems like abandoned project).

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