Incremental build support in Biztalk 2009 and 2010. .btproj projects?

While improving incremental improvements to build time, I found that .btproj files and, therefore, all other projects that depend on them, are being rebuilt (partially) on each incremental build. Tracking this to BizTalkCommon.targets, I found that it makes an assembly of 2 assembly assemblies, but only the first pass respects the already constructed artifacts, thereby violating the additional part of the dependency chain. An offensive target can be seen in BizTalkCommon.targets (line 228):

<!-- Delete the assembly and rerun the build process -->
<Target Name="SecondPass"
        Condition="$(SecondBuild)!=true and $(TempAssemblyOnly)!=true">

    <Delete Files="@(IntermediateAssembly)" />
    <MSBuild Projects="$(MSBuildProjectFile)" Properties="SecondBuild=true"/>
</Target>

I understand that there is a reason for assembling 2 sides, but I just can’t believe that it would be impossible to specify the corresponding inputs and outputs for the purpose in order to handle incremental assemblies correctly.

Does anyone know if there is a patch for the .targets file, or is there another good reason that incremental builds are not supported?

+5
source share
2 answers

You can enable incremental compilation of the MSBuild BizTalk project with a few very simple changes. Basically, you need to override the two goals that are defined in the file BizTalkCommon.targets.

These targets can be overridden in your own .btproj files and do not require changing the source .targets file that comes with BizTalk.

how

First, create your own .targets file to place your settings, for example BizTalkCustom.targets:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\BizTalk\BizTalkC.targets" />

<!-- Rerun the build process (second pass) -->
<Target Name="SecondPass" Condition="$(SecondBuild)!=true and $(TempAssemblyOnly)!=true and @(XLang)!=''">
    <MSBuild Projects="$(MSBuildProjectFile)" Properties="SecondBuild=true" />
</Target>

<!-- Compile XLang/s orchestration -->
<Target
    Name="CompileODX"
    Condition="$(SecondBuild)==true"
    Inputs="@(XLang);$(MSBuildAllProjects);$(ClrTypesAssembly)"
    Outputs="$(BuildDone)">

  <!-- Delete previously generated C# files from XLang compilation -->
  <Delete Files="@(IntermediateAssembly)" />
  <Delete Files="@(CSharpOutputFromXLang)" />

  <XLangTask XLangItems="@(XLang)"
             ProjectReferences="@(ReferencePath)"
             WarningLevel="$(WarningLevel)"
             BpelCompliance="$(BpelCompliance)"
             DefineConstants="$(DefineConstants)"
             TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
             TempAssembly="$(ClrTypesAssembly)"
             OutputDirectory="$(XLangOutputPath)">
  </XLangTask>
</Target>

Then replace the last statement Importin the .btproj file:

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MyCustomExtensions)\BizTalkCustom.targets" />

How it works

BizTalk Server - . , , .

, , BizTalkCommon.targets file. , :

  • SecondPass Target Condition. , , .

  • , Orchestrations, SecondPass Target , . , CompileODX Target , . Delete SecondPass Target CompiledODX.

, .

+3

, , BizTalk, . BizTalk "" VS, 2009 BizTalk . , , , , .

+1

All Articles