-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPublish NativeAOT - Windows.bat
35 lines (26 loc) · 1.35 KB
/
Publish NativeAOT - Windows.bat
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
@ECHO OFF
CD SpeedReader
:: Making sure library files exist, and download if they do not
IF NOT EXIST ".\Native\win-x64" MKDIR ".\Native\win-x64"
IF NOT EXIST .\Native\win-x64\libHarfBuzzSharp.lib ECHO Downloading libHarfBuzzSharp.lib (Approx 105 MB)...
IF NOT EXIST .\Native\win-x64\libHarfBuzzSharp.lib powershell -Command "Invoke-WebRequest https://github.com/brgishy/StaticFiles/raw/main/AvaloniaLibs/win-x64/libHarfBuzzSharp.lib?download= -Outfile .\Native\win-x64\libHarfBuzzSharp.lib"
IF NOT EXIST .\Native\win-x64\libSkiaSharp.lib ECHO Downloading libSkiaSharp.lib (Approx 392 MB)...
IF NOT EXIST .\Native\win-x64\libSkiaSharp.lib powershell -Command "Invoke-WebRequest https://github.com/brgishy/StaticFiles/raw/main/AvaloniaLibs/win-x64/libSkiaSharp.lib?download= -Outfile .\Native\win-x64\libSkiaSharp.lib"
:: Performing the Publish
SET CONFIG=Release
SET RUNTIME=win-x64
dotnet publish ^
-r %RUNTIME% ^
-c %CONFIG% ^
-p:PublishAOT=true ^
-p:TrimmerDefaultAction=link ^
-p:InvariantGlobalization=true ^
-p:IlcGenerateStackTraceData=false ^
-p:IlcOptimizationPreference=Size ^
-p:DebugType=none ^
-p:IlcFoldIdenticalMethodBodies=true ^
-p:IlcTrimMetadata=true
:: Removing unecessary files and copying the output to the root folder
DEL .\bin\%CONFIG%\net7.0\%RUNTIME%\publish\*.dll
MOVE .\bin\%CONFIG%\net7.0\%RUNTIME%\publish\*.exe ..
PAUSE