Elixir v1.5.0 Kernel.ParallelCompiler View Source

A module responsible for compiling files in parallel.

Link to this section Summary

Functions

Compiles the given files

Compiles the given files to the given path. Read files/2 for more information

Link to this section Functions

Link to this function files(files, options \\ []) View Source

Compiles the given files.

Those files are compiled in parallel and can automatically detect dependencies between them. Once a dependency is found, the current file stops being compiled until the dependency is resolved.

If there is an error during compilation or if warnings_as_errors is set to true and there is a warning, this function will fail with an exception.

This function accepts the following options:

  • :each_file - for each file compiled, invokes the callback passing the file

  • :each_long_compilation - for each file that takes more than a given timeout (see the :long_compilation_threshold option) to compile, invoke this callback passing the file as its argument

  • :long_compilation_threshold - the timeout (in seconds) after the :each_long_compilation callback is invoked; defaults to 10

  • :each_module - for each module compiled, invokes the callback passing the file, module and the module bytecode

  • :each_warning - for each warning, invokes the callback passing the file, line number, and warning message

  • :dest - the destination directory for the BEAM files. When using files/2, this information is only used to properly annotate the BEAM files before they are loaded into memory. If you want a file to actually be written to dest, use files_to_path/3 instead.

Returns the modules generated by each compiled file.

Link to this function files_to_path(files, path, options \\ []) View Source

Compiles the given files to the given path. Read files/2 for more information.