When using a genrule to generate ruby sources, it's helpful to output a directory and then use that for the sources of a ruby_library
For example:
genrule(
name = "gen-src-dir",
outs = ["some-directory"],
cmd = "mkdir -p $@ && touch $@/foo.rb $@/bar.rb"
)
ruby_library(
name = "my-lib",
srcs = [":gen-src-dir"],
)
Note that because these are generated files, it's hard to know what prefix to place in the include attribute, so ideally, that would allow itself to be relative to the output directory the genrule created.
When using a
genruleto generate ruby sources, it's helpful to output a directory and then use that for the sources of aruby_libraryFor example:
Note that because these are generated files, it's hard to know what prefix to place in the
includeattribute, so ideally, that would allow itself to be relative to the output directory thegenrulecreated.