use of com.google.devtools.build.lib.syntax.BuiltinFunction in project bazel by bazelbuild.
the class SkylarkRuleImplementationFunctionsTest method setupSkylarkFunction.
private void setupSkylarkFunction(String line) throws Exception {
mockFunc = new BuiltinFunction("mock") {
@SuppressWarnings("unused")
public Object invoke(Object mandatory, Object optional, Object mandatoryKey, Object optionalKey, Environment env) {
return EvalUtils.optionMap(env, "mandatory", mandatory, "optional", optional, "mandatory_key", mandatoryKey, "optional_key", optionalKey);
}
};
assertFalse(mockFunc.isConfigured());
mockFunc.configure(SkylarkRuleImplementationFunctionsTest.class.getDeclaredField("mockFunc").getAnnotation(SkylarkSignature.class));
update("mock", mockFunc);
eval(line);
}
Aggregations