Mark Heath  committed 0d027ff

We can now ramp our own version numbers

  • Participants
  • Parent commits 966eec4
  • Branches default

Comments (0)

Files changed (2)

File SetVersionTask/Properties/AssemblyInfo.cs

-using System.Reflection;
+using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers 
 // by using the '*' as shown below:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("")]
+[assembly: AssemblyVersion("")]
 [assembly: AssemblyFileVersion("")]

File SetVersionTask/SetVersionTask.csproj

     <Compile Include="VersionUpdateRule.cs" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <SetVersionPath>..\Tools\</SetVersionPath>
+  </PropertyGroup>
+  <UsingTask TaskName="SetVersion" AssemblyFile="$(SetVersionPath)SetVersionTask.dll" />
+  <Target Name="UpdateVersionNumber" Condition="Exists('$(SetVersionPath)SetVersionTask.dll')">
+    <Message Text="Updating Version..." />
+    <SetVersion FileName="Properties\AssemblyInfo.cs" Version="=.=.+.=" Condition="'$(Configuration)' == 'Release'"/>
+  </Target>
+  <Target Name="BeforeBuild" DependsOnTargets="UpdateVersionNumber">
+  </Target>
+  <Target Name="UpdateTools">
+    <!-- need to do a release build first, but can't include that here because MSBuild will be referencing the target DLL -->
+    <Copy SourceFiles="bin\Release\SetVersionTask.dll" DestinationFolder="$(SetVersionPath)" />
+  </Target>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
   <Target Name="AfterBuild">