This commit is contained in:
Cryolitia
2023-10-13 22:03:03 +08:00
parent bca3fb0747
commit 46ae69d599
5 changed files with 25 additions and 13 deletions

View File

@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<AssemblyVersion>4.25.1</AssemblyVersion>
<FileVersion>4.25.1</FileVersion>
<InformationalVersion>v4.25.1-alpha.1.d009.ga3f04669d</InformationalVersion>
<Version>4.25.1</Version>
</PropertyGroup>
</Project>

View File

@@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Target Name="TaggifyVersion" BeforeTargets="Build">
<Exec Command="powershell ./TaggifyVersion.ps1" />
<Message Text="Taggify Version" Importance="High" />
</Target>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<RootNamespace>MaaWpfGui</RootNamespace>

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>
@@ -20,8 +20,4 @@
<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

@@ -1,8 +0,0 @@
$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