Skip to content

Commit 2c51ca5

Browse files
committed
Apply code review suggestions
1 parent 7a0c02e commit 2c51ca5

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
@@ -358,6 +358,13 @@ defmodule Mix.Tasks.Deps.Compile do
358358
src = Path.join(build, "_gleam_artefacts")
359359
File.mkdir(Path.join(build, "ebin"))
360360

361+
# Remove per-environment segment from the path since ProjectStack.push below will append it
362+
build_path =
363+
Mix.Project.build_path()
364+
|> Path.split()
365+
|> Enum.drop(-1)
366+
|> Path.join()
367+
361368
config =
362369
Mix.Project.deps_config()
363370
|> Keyword.merge(
@@ -366,8 +373,7 @@ defmodule Mix.Tasks.Deps.Compile do
366373
deps: toml.deps,
367374
build_per_environment: true,
368375
lockfile: "mix.lock",
369-
# Remove per-environment segment from the path since ProjectStack.push below will append it
370-
build_path: Mix.Project.build_path() |> Path.split() |> Enum.drop(-1) |> Path.join(),
376+
build_path: build_path,
371377
build_scm: dep.scm,
372378
deps_path: deps_path,
373379
deps_app_path: build,
@@ -376,10 +382,10 @@ defmodule Mix.Tasks.Deps.Compile do
376382
erlc_include_path: Path.join(build, "include")
377383
)
378384

379-
env = dep.opts[:env] || :prod
380385
old_env = Mix.env()
381386

382387
try do
388+
env = dep.opts[:env] || :prod
383389
Mix.env(env)
384390
Mix.ProjectStack.push(dep.app, config, "nofile")
385391

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)