Jenkins_A sample for msbuild file

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
  <PropertyGroup>
    <AssemblyVersion Condition="'$(AssemblyVersion)'==''">1.0.0</AssemblyVersion>
    <Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
  </PropertyGroup>

  <ItemGroup>
    <ProjectsToBuild Include="..\Jenkins\Data-DMDevelopment.sln" />
  </ItemGroup>
  <ItemGroup>
    <Jolen Include="..\Lib\Jolen\AssemblyInfo.cs" />
  </ItemGroup>
  <Target Name="Build" DependsOnTargets="SetVersionInfo">
    <MSBuild Projects="@(ProjectsToBuild)" Properties="Configuration=$(Configuration)" />
  </Target>
  <Target Name="SetVersionInfo">
    <Attrib Files="@(Jolen)" Normal="true" />
    <FileUpdate Files="@(Jolen)"
                                Regex="AssemblyFileVersion\(\&quot;.*&quot;\)\]"
                ReplacementText="AssemblyFileVersion(&quot;$(AssemblyVersion)&quot;)]" />
  </Target>
</Project>

 

 

你可能感兴趣的:(Jenkins)