Mark Heath avatar Mark Heath committed 0d027ff

We can now ramp our own version numbers

Comments (0)

Files changed (2)

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("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.10.0")]
 [assembly: AssemblyFileVersion("1.0.0.0")]

SetVersionTask/SetVersionTask.csproj

     <Compile Include="VersionUpdateRule.cs" />
   </ItemGroup>
   <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">
   </Target>
   -->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.