Skip to content

Commit

Permalink
Fix a bug
Browse files Browse the repository at this point in the history
Modules that are supposed to be ignored were included in error reports on incremental build (#64).
  • Loading branch information
sasa1977 committed Mar 28, 2024
1 parent cd3ff8d commit b74b786
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/boundary/mix/view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Boundary.Mix.View do

module_to_app =
for {app, _description, _vsn} <- Application.loaded_applications(),
module <- Boundary.Mix.app_modules(app),
module <- app_modules(app, main_app),
into: %{},
do: {module, app}

Expand Down Expand Up @@ -68,7 +68,7 @@ defmodule Boundary.Mix.View do

module_to_app =
for {app, _description, _vsn} <- Application.loaded_applications(),
module <- Boundary.Mix.app_modules(app),
module <- app_modules(app, view.main_app),
into: view.module_to_app,
do: {module, app}

Expand All @@ -81,7 +81,8 @@ defmodule Boundary.Mix.View do
apps,
%{view | module_to_app: module_to_app},
fn app, view ->
app_modules = Boundary.Mix.app_modules(app)
app_modules = app_modules(app, view.main_app)

module_to_app = for module <- app_modules, into: view.module_to_app, do: {module, app}
app_boundaries = load_app_boundaries(app, app_modules, module_to_app)
classifier = Classifier.classify(view.classifier, app, app_modules, app_boundaries)
Expand Down Expand Up @@ -196,6 +197,9 @@ defmodule Boundary.Mix.View do
do: module
end

defp app_modules(main_app, main_app), do: main_app_modules(main_app)
defp app_modules(app, _main_app), do: Boundary.Mix.app_modules(app)

defp main_app_modules(app) do
# We take only explicitly defined modules which we've seen in the compilation tracer. This
# allows us to drop some implicit modules, such as protocol implementations which are injected
Expand Down

0 comments on commit b74b786

Please sign in to comment.