rules_dotnet icon indicating copy to clipboard operation
rules_dotnet copied to clipboard

[Next] F# scripts?

Open njlr opened this issue 3 years ago • 0 comments

It would be nice to wrap F# scripts (.fsx files) in a Bazel target so that they can be run with Bazel, included as tools in sh_binary targets, etc.

Perhaps something like this?

fsharp_script(
  name = "foo",
  srcs = [ "Foo.fsx" ],
)

Then to run:

bazel run //:foo

Scripts can depend on other scripts, so there should probably be a deps list.

#load "AnotherScript.fsx"

To mimic sh_binary:

fsharp_script_library(
  name = "scripts",
  srcs = [ "AnotherScript.fsx" ],
)

fsharp_script(
  name = "foo",
  srcs = [ "Foo.fsx" ],
  deps = [ ":scripts" ],
)

njlr avatar Sep 08 '22 14:09 njlr