Skip to content

Commit da217a1

Browse files
committed
Apply code review suggestions
1 parent 01d54c5 commit da217a1

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

lib/mix/lib/mix/tasks/compile.app.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ defmodule Mix.Tasks.Compile.App do
270270

271271
defp merge_project_application(best_guess, _project, application) do
272272
if not Keyword.keyword?(application) do
273-
Mix.raise("Application configuration passed as :application should be a keyword list")
273+
Mix.raise(
274+
"Application configuration passed as :application should be a keyword list, , got: #{inspect(application)}"
275+
)
274276
end
275277

276278
Keyword.merge(best_guess, validate_properties!(application))

lib/mix/lib/mix/tasks/deps.compile.ex

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,13 @@ defmodule Mix.Tasks.Deps.Compile do
332332
src = Path.join(build, "_gleam_artefacts")
333333
File.mkdir(Path.join(build, "ebin"))
334334

335+
# Remove per-environment segment from the path since ProjectStack.push below will append it
336+
build_path =
337+
Mix.Project.build_path()
338+
|> Path.split()
339+
|> Enum.drop(-1)
340+
|> Path.join()
341+
335342
config =
336343
Mix.Project.deps_config()
337344
|> Keyword.merge(
@@ -340,8 +347,7 @@ defmodule Mix.Tasks.Deps.Compile do
340347
deps: toml.deps,
341348
build_per_environment: true,
342349
lockfile: "mix.lock",
343-
# Remove per-environment segment from the path since ProjectStack.push below will append it
344-
build_path: Mix.Project.build_path() |> Path.split() |> Enum.drop(-1) |> Path.join(),
350+
build_path: build_path,
345351
build_scm: dep.scm,
346352
deps_path: deps_path,
347353
deps_app_path: build,
@@ -350,10 +356,10 @@ defmodule Mix.Tasks.Deps.Compile do
350356
erlc_include_path: Path.join(build, "include")
351357
)
352358

353-
env = dep.opts[:env] || :prod
354359
old_env = Mix.env()
355360

356361
try do
362+
env = dep.opts[:env] || :prod
357363
Mix.env(env)
358364
Mix.ProjectStack.push(dep.app, config, "nofile")
359365

lib/mix/test/fixtures/gleam_dep/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The directory Mix will write compiled artifacts to.
22
/_build/
33

4-
# The directory gleam will write compiled artifacts to.
4+
# The directory Gleam will write compiled artifacts to.
55
/build/
66

77
# If the VM crashes, it generates a dump, let's ignore it too.

lib/mix/test/fixtures/subfolder/deeper_gleam_dep/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The directory Mix will write compiled artifacts to.
22
/_build/
33

4-
# The directory gleam will write compiled artifacts to.
4+
# The directory Gleam will write compiled artifacts to.
55
/build/
66

77
# If the VM crashes, it generates a dump, let's ignore it too.

0 commit comments

Comments
 (0)