Remove build event scripts for versions.

This commit is contained in:
leo 2020-07-06 09:15:36 +08:00
parent 0f5382e474
commit 41a5ac2dc8
2 changed files with 6 additions and 28 deletions

View file

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

View file

@ -483,33 +483,11 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>@echo off &amp;setlocal <PreBuildEvent>
setlocal enabledelayedexpansion </PreBuildEvent>
set file=$(SolutionDir)Properties\AssemblyInfo.cs
set temp=$(SolutionDir)Properties\AssemblyInfo.cs.tmp
set bak=$(SolutionDir)Properties\AssemblyInfo.cs.bk
echo BACKUP AssemblyInfo
copy /Y %25file%25 %25bak%25
echo Find Version
git describe &gt; VERSION
set /P version=&lt;VERSION
set search=1.0.0.0
(for /f "delims=" %25%25i in (%25file%25) do (
set "line=%25%25i"
set "line=!line:%25search%25=%25version%25!"
echo(!line!
))&gt;"%25temp%25"
del /f %25file%25
del /f VERSION
move %25temp%25 %25file%25
endlocal</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>del /f $(SolutionDir)Properties\AssemblyInfo.cs <PostBuildEvent>
move $(SolutionDir)Properties\AssemblyInfo.cs.bk $(SolutionDir)Properties\AssemblyInfo.cs</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>