FSharpPacker 1.0.2

dotnet tool install --global FSharpPacker --version 1.0.2                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local FSharpPacker --version 1.0.2                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=FSharpPacker&version=1.0.2                
nuke :add-package FSharpPacker --version 1.0.2                

FSharp Packer

This tool allows package FSX files as self-contained executables.

Installation:

dotnet tool install --global FSharpPacker

Nix (Nix/NixOS)

Nix w/ Flakes

nix profile install github:kant2002/FSharpPacker

Run without installing

nix run github:kant2002/FSharpPacker -- --help

Usage

USAGE: fspack <file> [--help] [--framework <framework>] [--verbose] [--noselfcontained] [--aot]

FILE:

<file>                .fsx file to convert to executable file

OPTIONS:

--framework, -f <framework>
                      Specify target framework (e.g. net6.0)
--verbose, -v         Verbose output
--noselfcontained, -nsc
                      Don't publish as self-contained (with dotnet runtime included)
--singefile, -sf      Produce single file
--aot, -aot           Enable AOT-compilation
--help                display this list of options.

Please note that the app is produced as self-contained by default.

Simple usage:

fspack fsx-file.fsx [<additional arguments to dotnet publish>]

For example:

fspack FSharpPacker.Tests\Samples\LoadFile.fsx -o test -r win-x64
test\LoadFile.exe

for AOT build

fspack FSharpPacker.Tests\Samples\LoadFile.fsx -aot -o test-aot -r win-x64 -f net7.0
test-aot\LoadFile.exe

Self-contained with dotnet 7 and a single-file executable:

fspack FSharpPacker.Tests/Samples/LoadFile.fsx  -o test-single-file -r win-x64 -f net7.0 -sf -p:EnableCompressionInSingleFile=true
test-single-file\LoadFile.exe

Supported FSX directives

Directive Status Notes
#load
#r "path\file.dll"
#r "nuget: package"
#r "nuget: package, version"
#load
#i "nuget: source-feed"
#quit
#r "custom: custom-path" This is tricky and require deep involvement with FSharp.Compiler.Services
#I "custom: custom-path-search-hint"

Ignored FSX directives

Directive
#help
#time

Producing Nuget package

dotnet pack FSharpPacker.FSharp -c Release
dotnet tool install FSharpPacker --global --add-source FSharpPacker.FSharp\bin\Release\ 
dotnet tool uninstall -g FSharpPacker
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.2 307 9/26/2023
1.0.1 192 9/26/2023
1.0.0 209 9/23/2023
0.0.3 455 10/11/2022
0.0.2 416 9/24/2022
0.0.1 428 9/22/2022