Skip to content

Commit 565fc8b

Browse files
author
Gustavo Dutra
committed
Only mix compile -q recompiles unnecessarly
mix compile --quick was recompiling previously compiled files even when nothing had changed
1 parent a6317d5 commit 565fc8b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/mix/lib/mix/tasks/compile.elixir.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ defmodule Mix.Tasks.Compile.Elixir do
8585
Code.compiler_options(opts)
8686
to_compile = lc f inlist to_compile, f in stale, do: f
8787
compile_files(to_compile, compile_path)
88+
File.touch! Path.join(compile_path, @manifest)
8889
end
8990

9091
defp compile_files(false, project, compile_path, to_compile, _stale) do

lib/mix/test/mix/tasks/compile.elixir_test.exs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ defmodule Mix.Tasks.Compile.ElixirTest do
105105

106106
assert_received { :mix_shell, :info, ["Compiled lib/a.ex"] }
107107
refute_received { :mix_shell, :info, ["Compiled lib/b.ex"] }
108+
109+
File.touch!("ebin/.compile.elixir", future)
110+
111+
assert Mix.Tasks.Compile.Elixir.run(["--quick"]) == :noop
108112
end
109113
after
110114
purge [A, B, C]
111115
end
112-
end
116+
end

0 commit comments

Comments
 (0)