Skip to content

Improve Paket.Bootstrapper.exe and Paket.exe for use in F# Scripting #1759

@cloudRoutine

Description

@cloudRoutine

I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions