-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ps1
43 lines (28 loc) · 2.07 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
param(
[string] $Version = "0.1.2.0"
)
$ErrorActionPreference = "Stop";
Write-Output "Start building launcher...";
Set-Location hollow-launcher;
xmake;
Set-Location ..;
Write-Output "Start building withRuntime...";
dotnet publish Hollow.Windows/Hollow.Windows.csproj -o "build/$Version/Hollow_withRuntime/hollow_app" -r win-x64 -p:SelfContained=true -p:AssemblyVersion=$Version -p:Configuration=Release;
Write-Output "Removing unused files of withRuntime...";
Remove-Item -Path ./build/$Version/Hollow_withRuntime/hollow_app/Microsoft.Web.WebView2.Core.xml
Remove-Item -Path ./build/$Version/Hollow_withRuntime/hollow_app/Microsoft.Web.WebView2.WinForms.dll
Remove-Item -Path ./build/$Version/Hollow_withRuntime/hollow_app/Microsoft.Web.WebView2.WinForms.xml
Remove-Item -Path ./build/$Version/Hollow_withRuntime/hollow_app/Microsoft.Web.WebView2.Wpf.dll
Remove-Item -Path ./build/$Version/Hollow_withRuntime/hollow_app/Microsoft.Web.WebView2.Wpf.xml
Copy-Item -Path ".\hollow-launcher\build\windows\x64\release\HollowLauncher.exe" -Destination ".\build\$Version\Hollow_withRuntime\Hollow.exe"
Write-Output "Start building withoutRuntime...";
dotnet publish Hollow.Windows/Hollow.Windows.csproj -o "build/$Version/Hollow_withoutRuntime/hollow_app" -r win-x64 -p:SelfContained=false -p:AssemblyVersion=$Version -p:Configuration=Release;
Write-Output "Removing unused files of withoutRuntime...";
Remove-Item -Path ./build/$Version/Hollow_withoutRuntime/hollow_app/Microsoft.Web.WebView2.Core.xml
Remove-Item -Path ./build/$Version/Hollow_withoutRuntime/hollow_app/Microsoft.Web.WebView2.WinForms.dll
Remove-Item -Path ./build/$Version/Hollow_withoutRuntime/hollow_app/Microsoft.Web.WebView2.WinForms.xml
Remove-Item -Path ./build/$Version/Hollow_withoutRuntime/hollow_app/Microsoft.Web.WebView2.Wpf.dll
Remove-Item -Path ./build/$Version/Hollow_withoutRuntime/hollow_app/Microsoft.Web.WebView2.Wpf.xml
Copy-Item -Path ".\hollow-launcher\build\windows\x64\release\HollowLauncher.exe" -Destination ".\build\$Version\Hollow_withoutRuntime\Hollow.exe"
Write-Output "Build Finished";
[Console]::ReadKey()