Improve Paket.Bootstrapper.exe and Paket.exe for use in F# Scripting
See original GitHub issueI know there’s an example of how to use Paket inside a fsx, but I think the usage of Paket.Bootstrapper and Paket in F# scripts could be greatly improved by modifying the exposure of their API for consumption and the addition of a few more functions for ease of use.
After a minor tweak to expose the main function of the bootstrapper setting up a Fake build script intended to be run with fsi
and appropriate for inclusion in a github repo was as simple as
#r "./.paket/paket.bootstrapper.exe"
Paket.Bootstrapper.Program.Main [|""|]
#r "./.paket/paket.exe"
let dependencies = Paket.Dependencies.Locate __SOURCE_DIRECTORY__
dependencies.Restore()
#r "packages/Fake/FakeLib.dll"
open Fake
Adding a parsing function that takes the same strings as main
does on the commandline that writes the output to console would make this easy to use by anyone already familiar with the bootstrapper.
The surface area of Paket’s public API seems a bit excessive but maybe that’s not too important
Like the bootstrapper Paket.exe should expose a parsing function taking commandline args as strings and that writes its output to console.
At the same time all of the commands should be exposed in a strongly typed manner to allow more complex programmatic construction and execution of paket’s functions. Maybe it’d be useful to more concretely model the domain space for the types returned by these functions?
It could also be useful to implement help message functions for the exposed scripting apis that give back intellisense-like or explanatory information about the functions based on their names since there won’t be any intellisense provided by an xml file shipped with the .exe
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (8 by maintainers)
Top GitHub Comments
@brianary please try load scripts. Works really well ihmo, and are easier to reason about (just create a group if you want to isolate deps of a script, like for fake build )
If not, please reopen this or another issue
I see, it looks like it’s now https://fsprojects.github.io/Paket/paket-generate-load-scripts.html