Skip to content

Commit 46314f2

Browse files
committed
update build script
1 parent 110e374 commit 46314f2

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

MaiChartManager/AppMain.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
namespace MaiChartManager;
1212

13-
public class AppMain : ISingleInstance
13+
public partial class AppMain : ISingleInstance
1414
{
15-
public const string Version = "1.7.2.7";
1615
public static Browser? BrowserWin { get; set; }
1716

1817
private Launcher _launcher;

MaiChartManager/AppMain.g.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Auto-generated file. Do not modify manually.
2+
namespace MaiChartManager;
3+
4+
public partial class AppMain
5+
{
6+
public const string Version = "1.7.3";
7+
}

Packaging/Build.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,23 @@ Write-Host "Target Version: $BuildVersion" -ForegroundColor Green
4343
# Canary 模式使用完整的 4 段版本号 ($BuildVersion)
4444
# Release 模式使用 3 段版本号 ($baseVer)
4545
Write-Host "Updating C# source version..." -ForegroundColor Cyan
46-
$AppMainPath = "$ProjectRoot\MaiChartManager\AppMain.cs"
47-
$AppMainContent = Get-Content $AppMainPath -Raw
46+
$AppMainPath = "$ProjectRoot\MaiChartManager\AppMain.g.cs"
4847

4948
if ($Mode -eq "Canary") {
5049
$SourceVersion = $BuildVersion
5150
} else {
5251
$SourceVersion = $baseVer
5352
}
5453

55-
$AppMainContent = $AppMainContent -replace 'public const string Version = "[^"]+"', "public const string Version = ""$SourceVersion"""
54+
$AppMainContent = @"
55+
// Auto-generated file. Do not modify manually.
56+
namespace MaiChartManager;
57+
58+
public partial class AppMain
59+
{
60+
public const string Version = "$SourceVersion";
61+
}
62+
"@
5663
Set-Content $AppMainPath $AppMainContent -Encoding UTF8
5764

5865

0 commit comments

Comments
 (0)