### Boundary Compiler Warning Example Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile Illustrates a typical compiler warning generated by the boundary compiler when a forbidden cross-boundary function call is detected. It shows the warning message and the source file location. ```elixir defmodule MySystem.User do def auth do MySystemWeb.Endpoint.url() end end ``` ```text $ mix compile warning: forbidden reference to MySystemWeb (references from MySystem to MySystemWeb are not allowed) lib/my_system/user.ex:3 ``` -------------------------------- ### Boundary Mix Tasks Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary.Visualize Lists available Mix tasks for the Boundary project, including tasks for visualizing functions and modules, finding external dependencies, and compiling boundary code. ```elixir mix boundary.ex_doc_groups mix boundary.find_external_deps mix boundary.spec mix boundary.visualize mix boundary.visualize.funs mix boundary.visualize.mods mix compile.boundary ``` -------------------------------- ### Boundary Module API Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary.Visualize API documentation for the Boundary module, including its functions and their parameters. ```APIDOC Boundary: diagnostic(message, opts \\ []) - Logs a diagnostic message. - Parameters: - message: The message to log (string). - opts: Options for logging (keyword list, optional). ``` -------------------------------- ### Configure Boundary Compiler in mix.exs Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile Demonstrates how to include the boundary compiler in your project's `mix.exs` file to enable cross-module function call verification. ```elixir defmodule MySystem.MixProject do # ... def project do [ # ... compilers: [:boundary] ++ Mix.compilers(), # ... ] end # ... end ``` -------------------------------- ### Mix Compile Boundary Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary Handles the compilation process for the Boundary project, including diagnostics and warnings. ```elixir mix compile.boundary ``` -------------------------------- ### Mix Boundary Visualize Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary Generates a Graphviz dot file for each non-empty boundary. This task is used for visualizing project boundaries. ```elixir mix boundary.visualize ``` -------------------------------- ### Boundary Compile Task Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary.Visualize Handles the compilation of boundary-related code, including usage instructions and warnings. ```elixir mix compile.boundary ``` -------------------------------- ### Boundary API Documentation Source: https://hexdocs.pm/boundary/Boundary This section details the functions available in the Boundary module for managing and querying module boundaries. It covers functions for fetching, filtering, and analyzing module relationships. ```APIDOC Boundary: all(view) :: list(t()) Returns all boundaries defined in the view. app(view, module) :: t() | nil Finds the boundary that a given module belongs to within the view. errors(view, references) :: list(dep_error()) Checks for dependency errors between modules based on provided references. fetch(view, name) :: {:ok, t()} | :error Fetches a boundary by its name from the view. fetch!(view, name) :: t() Fetches a boundary by its name, raising an error if not found. for_module(view, module) :: t() | nil Finds the boundary that a given module belongs to. get(view, name) :: t() | nil Retrieves a boundary by its name from the view. parent(view, map) :: t() | nil Finds the parent boundary for a given map of module dependencies. protocol_impl?(module) :: boolean Checks if a module implements a protocol. siblings?(boundary1, boundary2) :: boolean Checks if two boundaries are siblings. unclassified_modules(view) :: list(atom()) Returns a list of modules that are not classified within any boundary. view(app) :: t() Creates a view of boundaries for a given application. Types: dep_error :: {atom(), atom(), atom(), atom()} error :: {atom(), atom(), atom()} export :: {atom(), list(atom())} mode :: :strict | :flexible name :: atom() reference_error :: {atom(), atom(), atom(), atom()} t :: %Boundary.t{} view :: %Boundary.view{} ``` -------------------------------- ### Mix Task: boundary.visualize.mods Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile This Mix task focuses on visualizing module-level information within the Boundary project, potentially showing module dependencies or structures. ```APIDOC mix boundary.visualize.mods Description: Visualizes module-level information in the Boundary project. Usage: Execute this task to visualize the structure and relationships between modules. ``` -------------------------------- ### Mix Task: boundary.visualize Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile This Mix task provides visualization capabilities for the Boundary project, helping to understand code structure, dependencies, or call graphs. ```APIDOC mix boundary.visualize Description: Visualizes aspects of the Boundary project. Usage: Run this task to generate visual representations of the project's architecture or code flow. ``` -------------------------------- ### Mix Boundary Visualize Modules Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary A specific Mix task for visualizing modules within the Boundary project. ```elixir mix boundary.visualize.mods ``` -------------------------------- ### Conditional Boundary Compiler for Libraries Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile Shows how to conditionally include the boundary compiler for development and test environments when building a library, preventing it from running in production. ```elixir defmodule Boundary.MixProject do # ... def project do [ # ... compilers: extra_compilers(Mix.env()) ++ Mix.compilers(), # ... ] end defp extra_compilers(:prod), do: [] defp extra_compilers(_env), do: [:boundary] end ``` -------------------------------- ### Visualize Cross-Function Dependencies Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary.Visualize Visualizes cross-function dependencies within a single module using the graphviz dot language. The output is printed to standard output. ```elixir mix boundary.visualize.funs SomeModule ``` -------------------------------- ### Mix Boundary Visualize Functions Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary A specific Mix task for visualizing functions within the Boundary project. ```elixir mix boundary.visualize.funs ``` -------------------------------- ### Mix Boundary Spec Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary This Mix task is related to generating specifications for the Boundary project. ```elixir mix boundary.spec ``` -------------------------------- ### Mix Boundary Find External Dependencies Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary This Mix task helps in identifying and analyzing external dependencies within the project. ```elixir mix boundary.find_external_deps ``` -------------------------------- ### Mix Boundary ExDoc Groups Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary This Mix task is used for managing ExDoc groups, facilitating integration with ExDoc for better documentation organization. ```elixir mix boundary.ex_doc_groups ``` -------------------------------- ### Mix Task: boundary.ex_doc_groups Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile This Mix task is used for managing ExDoc groups within the Boundary project, facilitating better organization and navigation of documentation. ```APIDOC mix boundary.ex_doc_groups Description: Manages ExDoc groups for the Boundary project. Usage: Run this task from your project's root directory to organize ExDoc documentation. Integration with ExDoc: This task integrates with ExDoc to structure documentation, potentially by grouping related modules or functions. ``` -------------------------------- ### Mix Task: compile.boundary Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile The primary Mix task for compiling the Boundary project. It verifies cross-module function calls against defined boundaries and reports violations as compiler warnings. ```APIDOC mix compile.boundary Description: Verifies cross-module function calls according to defined boundaries. Reports all cross-boundary function calls that are not permitted. Usage: This compiler is automatically invoked when included in the `compilers` list in `mix.exs`. Warnings: Invalid cross-boundary usage is reported as compiler warnings. Example warning: warning: forbidden reference to MySystemWeb (references from MySystem to MySystemWeb are not allowed) lib/my_system/user.ex:3 Compiler warnings do not halt compilation. To enforce boundaries strictly, use `mix compile --warnings-as-errors`. Related Tasks: - `mix compile` (standard Elixir compilation task) Configuration: Boundaries are defined in the `Boundary` module documentation. ``` -------------------------------- ### Mix Task: boundary.find_external_deps Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile This Mix task is designed to identify and report external dependencies within the Boundary project, aiding in dependency management and analysis. ```APIDOC mix boundary.find_external_deps Description: Finds and lists external dependencies used by the Boundary project. Usage: Execute this task to get an overview of the project's external dependencies. ``` -------------------------------- ### Boundary Compile Diagnostic Function Source: https://hexdocs.pm/boundary/Mix.Tasks.Boundary Provides diagnostic information during the compilation of the Boundary project. It takes a message and options as arguments. ```elixir Mix.Tasks.Compile.Boundary.diagnostic(message, opts \\ \[\]) ``` -------------------------------- ### Mix Task: boundary.visualize.funs Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile A specialized Mix task for visualizing function-level details within the Boundary project, likely showing function calls or relationships. ```APIDOC mix boundary.visualize.funs Description: Visualizes function-level information in the Boundary project. Usage: Use this task to visualize relationships and calls between functions. ``` -------------------------------- ### Mix Task: boundary.spec Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile This Mix task is used for generating or validating specifications related to the Boundary project, likely for defining or checking code contracts. ```APIDOC mix boundary.spec Description: Handles specifications for the Boundary project. Usage: This task can be used for generating or verifying code specifications. ``` -------------------------------- ### Diagnostic Function Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile The `diagnostic` function is used for logging diagnostic messages. It accepts a message string and an optional list of options. This function is part of the compilation tasks in the Boundary mix project. ```Elixir diagnostic(message, opts \\ []) ``` -------------------------------- ### Boundary Compiler Diagnostic Function Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile Details the `diagnostic/2` function used by the boundary compiler, likely for reporting specific diagnostic messages during compilation. ```APIDOC diagnostic(message, opts \\ []) Description: Reports a diagnostic message during the boundary compilation process. Parameters: - message: The diagnostic message string. - opts: A list of options, defaulting to an empty list. Returns: Typically returns `:ok` or similar success indicator, or raises an error if the diagnostic indicates a critical failure. Source: https://hexdocs.pm/boundary/Mix.Tasks.Compile.Boundary.html#diagnostic/2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.