Tagged Version

This commit is contained in:
Cryolitia
2023-10-13 06:53:46 +08:00
parent a3f04669db
commit bca3fb0747
3 changed files with 17 additions and 1 deletions

View File

@@ -67,6 +67,10 @@
<PropertyChanged />
</Weavers>
</WeaverConfiguration>
<AssemblyVersion>4.25.1</AssemblyVersion>
<FileVersion>4.25.1</FileVersion>
<InformationalVersion>v4.25.1-alpha.1.d009.ga3f04669d</InformationalVersion>
<Version>$(AssemblyVersion)</Version>
</PropertyGroup>
<ItemGroup>
@@ -166,4 +170,4 @@
<ItemGroup>
<Resource Include="newlogo.ico" />
</ItemGroup>
</Project>
</Project>

View File

@@ -20,4 +20,8 @@
<Copy SourceFiles="@(MaaResourceFiles)" DestinationFiles="$(MSBuildProjectDirectory)\..\..\$(Platform)\$(Configuration)\resource\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />
<Copy SourceFiles="@(MaaPythonBinding)" DestinationFiles="$(MSBuildProjectDirectory)\..\..\$(Platform)\$(Configuration)\Python\%(RecursiveDir)%(Filename)%(Extension)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />
</Target>
<Target Name="TaggifyVersion" BeforeTargets="Build">
<Exec Command="powershell ./TaggifyVersion.ps1" />
<Message Text="Taggify Version" Importance="High" />
</Target>
</Project>

View File

@@ -0,0 +1,8 @@
$tag = (Invoke-Expression "git describe --abbrev=0 --tags") -replace '.*?/', ''
$tag -match '\d+\.\d+\.\d+'
(Get-Content ..\MaaWpfGui\MaaWpfGui.csproj) |
ForEach-Object {
$_ -replace '(?<a>(<(Assembly|File)Version>)).*?(?<b>(</(Assembly|File)Version>))', ('${a}' + $Matches[0] + '${b}')`
-replace '(?<a>(<InformationalVersion>)).*?(?<b>(</InformationalVersion>))', ('${a}' + $tag + '${b}')
} |
Set-Content ..\MaaWpfGui\MaaWpfGui.csproj