locked
Dividing drop folder to sub folders RRS feed

  • Question

  • Hi,

     I defined build definition with more than one item to build (some .csProj).

    Everything works well, but all the binaries are being copy to the drop location into the same folder.

    Is there any way to create sub-folder for each item-to-build without changing the template.xamlx?

    Thanks.

    Asaf.

    Monday, January 31, 2011 10:27 AM

Answers

  • To achieve this, you need to make the changes both BuildTemplate.xaml and Code Project files. If you do not make changes Build Process Template, the OutDir property overrides any customized directory structure logic that you implement in the code project.

    a) In BuildProcessTemplate, go to Run MSBuild for Project and click properties . Remove the outputDirectory value from OutDir property.

    2) Properties pane, set the CommandLineArguments property to the following value:

    String.Format("/p:SkipInvalidConfigurations=true;TeamBuildOutDir=""{0}"" {1}",
    BinariesDirectory, MSBuildArguments)

    3) Checkin the BuildProcessTemplate.

    b) Changes to Code Projects:

    1. In Solution Explorer , right-click the project. If the Unload Project command is available, click it.

    2. Right-click the project, and then click Edit ProjectName .

    3. If the project is a managed code project, such as Visual C# or Visual Basic: add an OutputPath element. You must position this element after the last OutputPath element that already is in the code project.

      • <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003 ...">
        ...
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'">
        ...
        <OutputPath>bin\Debug\</OutputPath>
        ...
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
        ...
        <OutputPath>bin\Release\</OutputPath>
        ...
        </PropertyGroup>

        <PropertyGroup Condition="$(TeamBuildOutDir) != '' ">
        <OutputPath>$(TeamBuildOutDir)\$(SolutionName)\$(MSBuildProjectName)\$(Configuration)</OutputPath>
        </PropertyGroup>
      • Save and check in the changes. You need to repeat this steps for each solution which is part of Builds.

     

    • Marked as answer by Asaf Benyamin Monday, January 31, 2011 3:30 PM
    Monday, January 31, 2011 1:27 PM

All replies

  • To achieve this, you need to make the changes both BuildTemplate.xaml and Code Project files. If you do not make changes Build Process Template, the OutDir property overrides any customized directory structure logic that you implement in the code project.

    a) In BuildProcessTemplate, go to Run MSBuild for Project and click properties . Remove the outputDirectory value from OutDir property.

    2) Properties pane, set the CommandLineArguments property to the following value:

    String.Format("/p:SkipInvalidConfigurations=true;TeamBuildOutDir=""{0}"" {1}",
    BinariesDirectory, MSBuildArguments)

    3) Checkin the BuildProcessTemplate.

    b) Changes to Code Projects:

    1. In Solution Explorer , right-click the project. If the Unload Project command is available, click it.

    2. Right-click the project, and then click Edit ProjectName .

    3. If the project is a managed code project, such as Visual C# or Visual Basic: add an OutputPath element. You must position this element after the last OutputPath element that already is in the code project.

      • <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003 ...">
        ...
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86'">
        ...
        <OutputPath>bin\Debug\</OutputPath>
        ...
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
        ...
        <OutputPath>bin\Release\</OutputPath>
        ...
        </PropertyGroup>

        <PropertyGroup Condition="$(TeamBuildOutDir) != '' ">
        <OutputPath>$(TeamBuildOutDir)\$(SolutionName)\$(MSBuildProjectName)\$(Configuration)</OutputPath>
        </PropertyGroup>
      • Save and check in the changes. You need to repeat this steps for each solution which is part of Builds.

     

    • Marked as answer by Asaf Benyamin Monday, January 31, 2011 3:30 PM
    Monday, January 31, 2011 1:27 PM
  • Hi,

    I needed to do something similar and implemented the proposal above and it works well but I would prefer not to touch
    the project files. Both for practical reasons (I had to edit 22 files or something) and for more philosophical (the OutputPath property belongs to the build rather than the project; If you want to include the same project in two different builds with
    different strategies for subfolders, you are lost)

    Is it possible to accomplish subfolders by only adding stuff to the build definition and using some kind of "mix-in" property
    that you apply to the projects included in the build?

    Thanks

    Wednesday, October 26, 2011 6:23 PM