Search in sources :

Example 1 with QueryOutputsMacroExpander

use of com.facebook.buck.rules.macros.QueryOutputsMacroExpander in project buck by facebook.

the class QueryOutputsMacroExpanderTest method setUp.

@Before
public void setUp() throws Exception {
    expander = new QueryOutputsMacroExpander(Optional.empty());
    handler = new MacroHandler(ImmutableMap.of("query", expander));
    filesystem = new FakeProjectFilesystem(tmp.getRoot());
    cellNames = TestCellBuilder.createCellRoots(filesystem);
    TargetNode<?, ?> depNode = JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance(filesystem, "//exciting:dep"), filesystem).addSrc(Paths.get("Dep.java")).build();
    TargetNode<?, ?> ruleNode = JavaLibraryBuilder.createBuilder(BuildTargetFactory.newInstance(filesystem, "//exciting:target"), filesystem).addSrc(Paths.get("Other.java")).addDep(depNode.getBuildTarget()).build();
    TargetGraph targetGraph = TargetGraphFactory.newInstance(depNode, ruleNode);
    ruleResolver = new BuildRuleResolver(targetGraph, new DefaultTargetNodeToBuildRuleTransformer());
    dep = ruleResolver.requireRule(depNode.getBuildTarget());
    rule = ruleResolver.requireRule(ruleNode.getBuildTarget());
}
Also used : MacroHandler(com.facebook.buck.rules.macros.MacroHandler) QueryOutputsMacroExpander(com.facebook.buck.rules.macros.QueryOutputsMacroExpander) FakeProjectFilesystem(com.facebook.buck.testutil.FakeProjectFilesystem) TargetGraph(com.facebook.buck.rules.TargetGraph) DefaultTargetNodeToBuildRuleTransformer(com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer) BuildRuleResolver(com.facebook.buck.rules.BuildRuleResolver) Before(org.junit.Before)

Aggregations

BuildRuleResolver (com.facebook.buck.rules.BuildRuleResolver)1 DefaultTargetNodeToBuildRuleTransformer (com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer)1 TargetGraph (com.facebook.buck.rules.TargetGraph)1 MacroHandler (com.facebook.buck.rules.macros.MacroHandler)1 QueryOutputsMacroExpander (com.facebook.buck.rules.macros.QueryOutputsMacroExpander)1 FakeProjectFilesystem (com.facebook.buck.testutil.FakeProjectFilesystem)1 Before (org.junit.Before)1