Skip to content

Commit 6a0a768

Browse files
author
José Valim
committed
Preserving mtime needs to be invoked per task
1 parent 8e22a2c commit 6a0a768

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ defmodule Mix.Tasks.Compile.Elixir do
6969
stale = Mix.Utils.extract_stale(to_watch, [compile_path])
7070

7171
if opts[:force] or stale != [] do
72-
File.mkdir_p! compile_path
73-
compile_files opts[:quick], project, compile_path, to_compile, stale
72+
Mix.Utils.preserving_mtime(compile_path, fn ->
73+
File.mkdir_p! compile_path
74+
compile_files opts[:quick], project, compile_path, to_compile, stale
75+
end)
76+
7477
:ok
7578
else
7679
:noop

lib/mix/lib/mix/tasks/compile.erlang.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ defmodule Mix.Tasks.Compile.Erlang do
2828
if files == [] do
2929
:noop
3030
else
31-
File.mkdir_p! compile_path
32-
compile_files project, files, compile_path
31+
Mix.Utils.preserving_mtime(compile_path, fn ->
32+
File.mkdir_p! compile_path
33+
compile_files project, files, compile_path
34+
end)
35+
3336
:ok
3437
end
3538
end

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ defmodule Mix.Tasks.Compile do
6565
compile_path = Mix.project[:compile_path]
6666

6767
changed =
68-
Mix.Utils.preserving_mtime(compile_path, fn ->
69-
Enum.reduce get_compilers, false, fn(compiler, acc) ->
70-
res = Mix.Task.run "compile.#{compiler}", args
71-
acc or res != :noop
72-
end
73-
end)
68+
Enum.reduce get_compilers, false, fn(compiler, acc) ->
69+
res = Mix.Task.run "compile.#{compiler}", args
70+
acc or res != :noop
71+
end
7472

7573
# If any of the tasks above returns something different
7674
# than :noop, it means they produced something, so we

0 commit comments

Comments
 (0)