Skip to content

Commit

Permalink
publish sample as native AOT (not trimming commands)
Browse files Browse the repository at this point in the history
build using `dotnet publish -r linux-amd64 -c Release`
test with `bin/Release/net8.0/linux-x64/fsharp-spectre-console-template greet -n John`

based on spectreconsole/spectre.console#1332 (comment)
  • Loading branch information
fvn-elmy committed Jan 16, 2024
1 parent 41c0dd3 commit 325cb08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Program.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
open Spectre.Console.Cli
open Commands.Greet
open Spectre.Console.Cli
open Commands
open System.Diagnostics.CodeAnalysis

[<DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof<Hello>)>]
[<DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof<HelloSettings>)>]
[<DynamicDependency(DynamicallyAccessedMemberTypes.All, "Spectre.Console.Cli.ExplainCommand", "Spectre.Console.Cli")>]
[<DynamicDependency(DynamicallyAccessedMemberTypes.All, "Spectre.Console.Cli.VersionCommand", "Spectre.Console.Cli")>]
[<DynamicDependency(DynamicallyAccessedMemberTypes.All, "Spectre.Console.Cli.XmlDocCommand", "Spectre.Console.Cli")>]
[<EntryPoint>]
let main argv =

Expand All @@ -11,4 +18,4 @@ let main argv =
.WithDescription("Greets the user running the application.")
|> ignore)

app.Run(argv)
app.Run(argv)
1 change: 1 addition & 0 deletions fsharp-spectre-console-template.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishAot>true</PublishAot>
<RootNamespace>fsharp_spectre_console_template</RootNamespace>
</PropertyGroup>

Expand Down

0 comments on commit 325cb08

Please sign in to comment.