Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Peck 587 posts 1553 karma points c-trib
    Apr 20, 2017 @ 12:26
    David Peck
    0

    HOWTO: Get MSBuild/CI to update the client dependency framework

    I thought this would be useful to document but I don't have the time to blog it. If you're looking to update the client dependency framework, presumably using CI such as Jenkins or TeamCity then you can do the following:

    <Project>
    <!--The rest of the xml-->
      <Target Name="UpdateClientDependencyFrameworkVersion" AfterTargets="CopyAllFilesToSingleFolderForMsdeploy">
        <PropertyGroup>
          <VersionXPath>/clientDependency/@version</VersionXPath>
          <!-- You can test by setting a value here -->
          <!--<CdfVersion>2</CdfVersion>-->
        </PropertyGroup>
        <ItemGroup>
          <CdfConfigFiles Include="Config\ClientDependency.config" />
        </ItemGroup>
        <Message Text="Updating client dependency framework to version $(CdfVersion)" Importance="high" />
        <XmlPoke  XmlInputPath="@(CdfConfigFiles ->'$(WPPAllFilesInSingleFolder)\%(RelativeDir)%(Filename)%(Extension)')"
                Query="$(VersionXPath)"
                Value="$(CdfVersion)"/>
      </Target>
    </Project>
    

    This build task will insert in to /Config/ClientDependency.config a new version, which equals the same as the custom build property CdfVersion.

    Using your CI server you'll need to provide that value. In TeamCity you can use %build.counter%, and I'm sure a similar number exists in other systems.

    Also FYI: For config transforms of everything in the config folder checkout this topic.

  • David Peck 587 posts 1553 karma points c-trib
    Apr 20, 2017 @ 12:27
    David Peck
    100

    The question provides the solution.

  • MrFlo 148 posts 390 karma points
    Apr 20, 2017 @ 12:34
    MrFlo
    0

    That could be useful indeed! Which CI are you using ?

  • David Peck 587 posts 1553 karma points c-trib
    Apr 20, 2017 @ 12:35
    David Peck
    0

    TeamCity v7 with MSDeploy currently. Quite like it but badly needs upgrading (not my call) and using Octopus deploy rather than MSDeploy.

Please Sign in or register to post replies

Write your reply to:

Draft