Class QueryTargetsAndOutputsMacroExpander

  • All Implemented Interfaces:
    MacroExpander<QueryTargetsAndOutputsMacro,​QueryMacroExpander.QueryResults>

    public class QueryTargetsAndOutputsMacroExpander
    extends QueryMacroExpander<QueryTargetsAndOutputsMacro>
    Used to expand the macro $(query_targets_and_outputs "some(query(:expression))") to the full target names and the set of the outputs of the targets matching the query separated by a space. Example queries
       '$(query_targets_and_outputs "deps(:foo)")'
       '$(query_targets_and_outputs "filter(bar, classpath(:bar))")'
       '$(query_targets_and_outputs "attrfilter(annotation_processors, com.foo.Processor, deps(:app))")'
     
    Example output:
     $(query_targets_and_outputs "deps(:foo)") ->
       "//:bar1 /tmp/project/buck-out/gen/bar1/out_file //:bar2 /tmp/project/buck-out/gen/bar2/out_file"