@@ -177,8 +177,6 @@ defmodule Mix.Compilers.Elixir do
177
177
end
178
178
179
179
defp each_module ( pid , cwd , source , module , binary ) do
180
- beam = Atom . to_string ( module ) <> ".beam"
181
-
182
180
{ compile_references , runtime_references } = Kernel.LexicalTracker . remote_references ( module )
183
181
184
182
compile_references =
@@ -214,7 +212,7 @@ defmodule Mix.Compilers.Elixir do
214
212
module: module ,
215
213
kind: kind ,
216
214
source: source ,
217
- beam: beam ,
215
+ beam: nil , # They are calculated when writing the manifest
218
216
binary: binary
219
217
)
220
218
@@ -265,8 +263,10 @@ defmodule Mix.Compilers.Elixir do
265
263
## Resolution
266
264
267
265
defp update_stale_sources ( sources , removed , changed ) do
266
+ # Remove delete sources
268
267
sources =
269
- Enum . reject ( sources , fn source ( source: source ) -> source in removed end )
268
+ Enum . reduce ( removed , sources , & List . keydelete ( & 2 , & 1 , source ( :source ) ) )
269
+ # Store empty sources for the changed ones as the compiler appends data
270
270
sources =
271
271
Enum . reduce ( changed , sources , & List . keystore ( & 2 , & 1 , source ( :source ) , source ( source: & 1 ) ) )
272
272
sources
@@ -394,13 +394,14 @@ defmodule Mix.Compilers.Elixir do
394
394
File . mkdir_p! ( Path . dirname ( manifest ) )
395
395
396
396
modules =
397
- for module ( beam: beam , binary: binary ) = module <- modules do
397
+ for module ( binary: binary , module: module ) = entry <- modules do
398
+ beam = Atom . to_string ( module ) <> ".beam"
398
399
if binary do
399
400
beam_path = Path . join ( compile_path , beam )
400
401
File . write! ( beam_path , binary )
401
402
File . touch! ( beam_path , timestamp )
402
403
end
403
- module ( module , binary: nil )
404
+ module ( entry , binary: nil , beam: beam )
404
405
end
405
406
406
407
manifest_data =
0 commit comments