mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
wpfGui: Taggify Version (#6894)
This commit is contained in:
1
src/MaaWpfGui/.gitignore
vendored
Normal file
1
src/MaaWpfGui/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Directory.Build.props
|
||||
@@ -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>
|
||||
|
||||
12
src/MaaWpfGui/TaggifyVersion.ps1
Normal file
12
src/MaaWpfGui/TaggifyVersion.ps1
Normal 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
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<Configurations>RelWithDebInfo;Release;Debug</Configurations>
|
||||
<Platforms>x64;ARM64</Platforms>
|
||||
|
||||
Reference in New Issue
Block a user