wpfGui: Taggify Version (#6894)

This commit is contained in:
uye
2023-10-14 22:16:39 +08:00
committed by GitHub
4 changed files with 20 additions and 3 deletions

1
src/MaaWpfGui/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
Directory.Build.props

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="TaggifyVersion">
<Target Name="TaggifyVersion">
<Exec Command="powershell ./TaggifyVersion.ps1" />
<Message Text="Taggify Version" Importance="High" />
</Target>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>MaaWpfGui</RootNamespace>
@@ -166,4 +170,4 @@
<ItemGroup>
<Resource Include="newlogo.ico" />
</ItemGroup>
</Project>
</Project>

View File

@@ -0,0 +1,12 @@
$tag = (Invoke-Expression "git describe --abbrev=0 --tags") -replace '.*?/', ''
$tag -match '\d+(\.\d+){0,3}'
$match = $Matches[0]
$props = "<Project>
<PropertyGroup>
<AssemblyVersion>$match</AssemblyVersion>
<FileVersion>$match</FileVersion>
<InformationalVersion>$tag</InformationalVersion>
<Version>$match</Version>
</PropertyGroup>
</Project>"
Set-Content -Path Directory.Build.props -Value $props

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>RelWithDebInfo;Release;Debug</Configurations>
<Platforms>x64;ARM64</Platforms>