Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/mix/lib/mix/tasks/compile.app.ex
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ defmodule Mix.Tasks.Compile.App do
Mix.Project.ensure_structure()
File.write!(target, IO.chardata_to_string(contents))
File.touch!(target, new_mtime)

# If we just created the .app file, it will have touched
# the directory mtime, so we need to reset it.
if current_properties == [] do
File.touch!(compile_path, new_mtime)
end

Mix.shell().info("Generated #{app} app")
{:ok, []}
else
Expand Down
4 changes: 0 additions & 4 deletions lib/mix/test/mix/tasks/compile.app_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ defmodule Mix.Tasks.Compile.AppTest do
test "generates .app file when changes happen" do
in_fixture("no_mixfile", fn ->
Mix.Project.push(MixTest.Case.Sample)
# Pre-create the compilation path to avoid mtime races
File.mkdir_p(Mix.Project.compile_path())

Mix.Tasks.Compile.Elixir.run([])
assert Mix.Tasks.Compile.App.run([]) == {:ok, []}
Expand Down Expand Up @@ -256,8 +254,6 @@ defmodule Mix.Tasks.Compile.AppTest do
test ".app contains description and registered (as required by systools)" do
in_fixture("no_mixfile", fn ->
Mix.Project.push(MixTest.Case.Sample)
# Pre-create the compilation path to avoid mtime races
File.mkdir_p(Mix.Project.compile_path())

Mix.Tasks.Compile.Elixir.run([])
assert Mix.Tasks.Compile.App.run([]) == {:ok, []}
Expand Down
Loading