File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,19 @@ defmodule Mix.Compilers.Elixir do
52
52
removed != [ ] ->
53
53
write_manifest ( manifest , entries ++ skip_entries )
54
54
:ok
55
+ File . exists? ( Mix.Project . app_path ) ->
56
+ # If we have an app path but a noop result, we rebuild
57
+ # the structure because priv/include needs to be recopied when
58
+ # symlink is not available. We do this in the Elixir compiler
59
+ # instead of the main compiler one because other compilers may
60
+ # return :ok, saying they did some work, but they may have not
61
+ # built a structure at all.
62
+ #
63
+ # This implies the Elixir compiler is somewhat required, even
64
+ # for Erlang projects, which is an ok assumption to make (we
65
+ # ship with both Elixir and Erlang compilers by default).
66
+ Mix.Project . build_structure ( )
67
+ :noop
55
68
true ->
56
69
:noop
57
70
end
Original file line number Diff line number Diff line change @@ -99,7 +99,9 @@ defmodule Mix.Tasks.Compile.App do
99
99
properties = ensure_correct_properties ( app , config , properties )
100
100
contents = { :application , app , properties }
101
101
102
- Mix.Project . build_structure ( config )
102
+ # There are no modules, we assume no structure was built.
103
+ # If it was built, it doesn't matter, we just rebuild it.
104
+ if mods == [ ] , do: Mix.Project . build_structure ( config )
103
105
File . write! ( target , :io_lib . format ( "~p." , [ contents ] ) )
104
106
105
107
Mix . shell . info "Generated #{ app } .app"
Original file line number Diff line number Diff line change @@ -64,10 +64,7 @@ defmodule Mix.Tasks.Deps.Compile do
64
64
"(pass :compile as an option to customize compilation, set it to false to do nothing)"
65
65
end
66
66
67
- # Always build the structure even for Mix projects
68
- # because if nothing was compiled, we need to re-copy
69
- # priv/include when symlinks are not available.
70
- build_structure ( dep , config )
67
+ unless mix? ( dep ) , do: build_structure ( dep , config )
71
68
touch_fetchable ( scm , opts [ :build ] )
72
69
compiled
73
70
end )
You can’t perform that action at this time.
0 commit comments