Skip to content

Commit aae0054

Browse files
committed
Fix trimmed publishing
1 parent 26a4eff commit aae0054

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

run.fs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ module DotNet =
4040
"-o"
4141
outDir
4242
"--self-contained"
43-
"/p:PublishSingleFile=true"
44-
"/p:PublishTrimmed=true"
45-
"/p:EnableCompressionInSingleFile=true"
46-
"/p:IncludeNativeLibrariesForSelfExtract=true"
47-
"/p:DebugType=None"
48-
$"/p:Version=%s{version}"
43+
"-p:PublishSingleFile=true"
44+
"-p:EnableCompressionInSingleFile=true"
45+
"-p:IncludeNativeLibrariesForSelfExtract=true"
46+
"-p:DebugType=None"
47+
$"-p:Version=%s{version}"
4948
project
5049
]
5150

@@ -91,13 +90,13 @@ module Task =
9190
"-r"
9291
"linux-x64"
9392
"--self-contained"
94-
"-p:PublishTrimmed=true"
9593
"-p:DebugType=None"
96-
$"/p:Version=%s{version}"
94+
$"-p:Version=%s{version}"
9795
Config.mainProject
9896
]
9997

10098
Shell.mkdir "AppDir/usr"
99+
Shell.cleanDir "AppDir/usr"
101100

102101
Shell.mv
103102
$"src/Andromeda/AvaloniaApp/bin/Release/{Config.framework}/linux-x64/publish"

src/Andromeda/AvaloniaApp/Andromeda.AvaloniaApp.fsproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
</PropertyGroup>
1010
<PropertyGroup>
1111
<Version>0</Version>
12+
<PublishTrimmed>true</PublishTrimmed>
1213
</PropertyGroup>
1314

1415
<ItemGroup>
1516
<ProjectReference Include="../Core/Andromeda.Core.fsproj" />
17+
<TrimmerRootDescriptor Include="Roots.xml" />
1618
</ItemGroup>
1719

1820
<ItemGroup>

src/Andromeda/AvaloniaApp/Program.fs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ open Andromeda.Core
44
open Elmish
55
open GogApi
66

7-
open System
87
open Avalonia
98
open Avalonia.Controls
109
open Avalonia.Controls.ApplicationLifetimes
1110
open Avalonia.FuncUI
1211
open Avalonia.FuncUI.Hosts
1312
open Avalonia.FuncUI.Elmish
14-
open Avalonia.Markup.Xaml.Styling
1513
open Avalonia.Themes.Simple
1614

1715
open Andromeda.AvaloniaApp
@@ -59,8 +57,8 @@ module Program =
5957

6058
override this.Initialize() =
6159
this.Styles.Add(new SimpleTheme())
62-
this.Styles.Load "avares://Andromeda.AvaloniaApp/Styles.xaml"
6360
this.RequestedThemeVariant <- Styling.ThemeVariant.Dark
61+
this.Styles.Load "avares://Andromeda.AvaloniaApp/Styles.xaml"
6462

6563
override this.OnFrameworkInitializationCompleted() =
6664
match this.ApplicationLifetime with
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<linker>
2+
<!-- We need this, because our styles have to be compiled -->
3+
<assembly fullname="Andromeda.AvaloniaApp">
4+
<type fullname="CompiledAvaloniaXaml.!XamlLoader">
5+
<method name="TryLoad" />
6+
</type>
7+
</assembly>
8+
<!-- This stuff uses reflection internally, those have to add support for trimming -->
9+
<assembly fullname="TypedPersistence.Json"/>
10+
<assembly fullname="GogApi"/>
11+
</linker>

0 commit comments

Comments
 (0)