Skip to content

Commit 80e45cb

Browse files
author
Jayce
committed
添加编译脚本;
添加版本号。
1 parent 43e8725 commit 80e45cb

File tree

2 files changed

+58
-6
lines changed

2 files changed

+58
-6
lines changed

Xpass.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
<SignAssembly>False</SignAssembly>
1313
<ErrorReport>none</ErrorReport>
1414
<IncludeSymbols>False</IncludeSymbols>
15+
<Version>1.3.0.0</Version>
1516
</PropertyGroup>
1617

17-
<ItemGroup>
18-
<Content Include="Resources\Icon.ico" />
19-
</ItemGroup>
20-
21-
22-
2318
</Project>

build.ps1

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
param (
2+
[Parameter()]
3+
[ValidateNotNullOrEmpty()]
4+
[string]
5+
$OutputPath = '.\bin\Xpass'
6+
)
7+
8+
Write-Host 'Building'
9+
10+
# 编译 x86 平台
11+
dotnet publish `
12+
.\Xpass.csproj `
13+
-c Release `
14+
--self-contained false `
15+
-p:PublishReadyToRun=true `
16+
-p:PublishSingleFile=true `
17+
-r win-x86 `
18+
-o "$OutputPath"
19+
20+
if (-Not $?) {
21+
exit $lastExitCode
22+
}
23+
24+
# 重命名输出文件并移除不必要的文件
25+
if (Test-Path -Path "$OutputPath\Xpass.exe") {
26+
mv -Path "$OutputPath\Xpass.exe" -Destination "$OutputPath\Xpass_x86.exe" -Force
27+
rm -Force "$OutputPath\*.pdb"
28+
rm -Force "$OutputPath\*.xml"
29+
}
30+
31+
# 编译 x64 平台
32+
dotnet publish `
33+
.\Xpass.csproj `
34+
-c Release `
35+
--self-contained false `
36+
-p:PublishReadyToRun=true `
37+
-p:PublishSingleFile=true `
38+
-r win-x64 `
39+
-o "$OutputPath"
40+
41+
if (-Not $?) {
42+
exit $lastExitCode
43+
}
44+
45+
# 重命名输出文件并移除不必要的文件
46+
if (Test-Path -Path "$OutputPath\Xpass.exe") {
47+
mv -Path "$OutputPath\Xpass.exe" -Destination "$OutputPath\Xpass_x64.exe" -Force
48+
rm -Force "$OutputPath\*.pdb"
49+
rm -Force "$OutputPath\*.xml"
50+
}
51+
52+
Write-Host 'Build done'
53+
54+
Write-Host 'Build done'
55+
56+
ls $OutputPath
57+
exit 0

0 commit comments

Comments
 (0)