tdApiBuilder function

Builder tdApiBuilder(
  1. BuilderOptions options
)

Implementation

Builder tdApiBuilder(BuilderOptions options) {
  final schemaPath =
      options.config['schema_path'] as String? ?? _defaultSchemaPath;
  final packageRoot = _findPackageRoot(schemaPath);
  final schema = File('${packageRoot.path}/$schemaPath').readAsStringSync();
  final generator = Generator(
    root: packageRoot.path,
    classes: Parser.fromSource(schema).parse(),
  );
  return TdApiBuilder(
    schemaPath: schemaPath,
    outputPaths: generator.outputPaths,
  );
}