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.
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:
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.
The question provides the solution.
That could be useful indeed! Which CI are you using ?
TeamCity v7 with MSDeploy currently. Quite like it but badly needs upgrading (not my call) and using Octopus deploy rather than MSDeploy.
is working on a reply...