Search in sources :

Example 1 with ImplicitOutputsFunction

use of com.google.devtools.build.lib.packages.ImplicitOutputsFunction in project bazel by bazelbuild.

the class SkylarkRuleClassFunctionsTest method testRuleOutputs.

@Test
public void testRuleOutputs() throws Exception {
    evalAndExport("def impl(ctx): return None", "r1 = rule(impl, outputs = {'a': 'a.txt'})");
    RuleClass c = ((RuleFunction) lookup("r1")).getRuleClass();
    ImplicitOutputsFunction function = c.getDefaultImplicitOutputsFunction();
    assertEquals("a.txt", Iterables.getOnlyElement(function.getImplicitOutputs(null)));
}
Also used : ImplicitOutputsFunction(com.google.devtools.build.lib.packages.ImplicitOutputsFunction) RuleFunction(com.google.devtools.build.lib.rules.SkylarkRuleClassFunctions.RuleFunction) RuleClass(com.google.devtools.build.lib.packages.RuleClass) Test(org.junit.Test)

Aggregations

ImplicitOutputsFunction (com.google.devtools.build.lib.packages.ImplicitOutputsFunction)1 RuleClass (com.google.devtools.build.lib.packages.RuleClass)1 RuleFunction (com.google.devtools.build.lib.rules.SkylarkRuleClassFunctions.RuleFunction)1 Test (org.junit.Test)1