bazel-deps icon indicating copy to clipboard operation
bazel-deps copied to clipboard

Optionally include the correct load statement for Scala files

Open greggdonovan opened this issue 6 years ago • 2 comments

For build files that include a scala rule, include the correct rules_scala load statement. E.g. if the BUILD file includes a scala_library rule, insert load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") before the rules in that file.

This provides an option when you might not want to include scala_library in the prelude. See discussion.

greggdonovan avatar Oct 14 '17 01:10 greggdonovan

so, you want something here like language specific headers?

I think that should be fine.

something like:

options:
  languageBuildHeaders:
    scala:
        - load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library")

so we can group options per language? And then we only emit the header if a file contains that language.

Open to other suggestions.

johnynek avatar Oct 14 '17 02:10 johnynek

Yes, that sounds great.

greggdonovan avatar Oct 14 '17 13:10 greggdonovan