Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #518
Closed
Open
Issue created Nov 18, 2015 by Mike Kaplinskiy@mikekap

Shorthand for including an output file of a genrule directory as a src

If you have a genrule that creates a directory with several files, it's a bit of a pain to write another genrule rule for each (expected) output, just to be able to pass it to *_library (java, python, etc). It would be nice to allow you to somehow specify this in the sources - maybe via flavors (although it is a bit hackish)? e.g.

genrule(
    name='gen_my_thing',
    out='things',
    cmd='$(exe :my_custom_generator) $SRCDIR $OUT',
    srcs=glob(['File1.java', 'File2.java']),
)

java_library(
    name='lib',
    srcs=[
        ':gen_my_thing#lib_output/File1Out.java',
        ':gen_my_thing#lib_output/File2Out.java',
    ]
)
Assignee
Assign to
Time tracking