rules_ocaml
rules_ocaml copied to clipboard
Make src_root optional when there's only one srcs
It would be nice to allow this:
ocaml_native_binary(
name = "ocaml",
srcs = "hello.ml",
)
In other words, when there's only one source file, it should be used as the root one.
Suggestion: Maybe rename src_root
to main
? I think it's a more common name.
Which of the following do you think is better?
ocaml_native_binary(
name = "hello",
srcs = ["hello.ml"],
# implies: main = "hello.ml"
)
or
ocaml_native_binary(
name = "hello",
main = "hello.ml",
# implies: srcs = ["hello.ml"]
)
I prefer the first.
Yes, I also prefer the first one.
You may add allow_empty=False
to srcs
.