@@ -122,6 +122,10 @@ defmodule Kernel.ParallelCompiler do
122122
123123 ## Options
124124
125+ * `:after_compile` - invoked after all modules are compiled, but before
126+ they are verified. If the files are being written to disk, such as in
127+ `compile_to_path/3`, this will be invoked after the files are written
128+
125129 * `:each_file` - for each file compiled, invokes the callback passing the
126130 file
127131
@@ -139,8 +143,6 @@ defmodule Kernel.ParallelCompiler do
139143 * `{:runtime, modules, warnings}` - to stop compilation and verify the list
140144 of modules because dependent modules have changed
141145
142- * `:after_persistence` - ...
143-
144146 * `:long_compilation_threshold` - the timeout (in seconds) to check for modules
145147 taking too long to compile. For each file that exceeds the threshold, the
146148 `:each_long_compilation` callback is invoked. From Elixir v1.11, only the time
@@ -285,7 +287,7 @@ defmodule Kernel.ParallelCompiler do
285287 spawn_workers ( files , % { } , % { } , [ ] , % { } , [ ] , [ ] , % {
286288 beam_timestamp: Keyword . get ( options , :beam_timestamp ) ,
287289 dest: Keyword . get ( options , :dest ) ,
288- after_persistence : Keyword . get ( options , :after_persistence , fn -> :ok end ) ,
290+ after_compile : Keyword . get ( options , :after_compile , fn -> :ok end ) ,
289291 each_cycle: Keyword . get ( options , :each_cycle , fn -> { :runtime , [ ] , [ ] } end ) ,
290292 each_file: Keyword . get ( options , :each_file , fn _ , _ -> :ok end ) |> each_file ( ) ,
291293 each_long_compilation: Keyword . get ( options , :each_long_compilation , fn _file -> :ok end ) ,
@@ -343,7 +345,7 @@ defmodule Kernel.ParallelCompiler do
343345
344346 defp verify_modules ( result , compile_warnings , dependent_modules , state ) do
345347 modules = write_module_binaries ( result , state . output , state . beam_timestamp )
346- _ = state . after_persistence . ( )
348+ _ = state . after_compile . ( )
347349 runtime_warnings = maybe_check_modules ( result , dependent_modules , state )
348350 info = % { compile_warnings: Enum . reverse ( compile_warnings ) , runtime_warnings: runtime_warnings }
349351 { { :ok , modules , info } , state }
0 commit comments