KiwiCodec.Compiler (kiwi_codec v0.1.0)

Copy Markdown View Source

Compiles .kiwi schema text into Elixir modules or source files.

Summary

Functions

Compiles a parsed schema into Elixir modules in memory.

Compiles schema text into Elixir modules in memory.

Generates Elixir source files from schema text.

Generates Elixir source files from a parsed schema.

Functions

compile_schema!(schema, opts)

@spec compile_schema!(
  KiwiCodec.Schema.t(),
  keyword()
) :: [module()]

Compiles a parsed schema into Elixir modules in memory.

compile_string!(text, opts)

@spec compile_string!(
  String.t(),
  keyword()
) :: [module()]

Compiles schema text into Elixir modules in memory.

This is intended for tests and tooling. Application code should usually use generate_files!/2 through mix kiwi.gen and compile generated source files with the project.

generate_files!(text, opts)

@spec generate_files!(
  String.t(),
  keyword()
) :: [Path.t()]

Generates Elixir source files from schema text.

generate_schema_files!(schema, opts)

@spec generate_schema_files!(
  KiwiCodec.Schema.t(),
  keyword()
) :: [Path.t()]

Generates Elixir source files from a parsed schema.