@@ -137,29 +137,26 @@ defmodule Mix.Compilers.Elixir do
137
137
|> List . delete ( module )
138
138
|> Enum . reject ( & match? ( "elixir_" <> _ , Atom . to_string ( & 1 ) ) )
139
139
140
- attributes = module . __info__ ( :attributes )
141
-
142
- kind = detect_kind ( attributes )
140
+ kind = detect_kind ( module )
143
141
source = Path . relative_to ( source , cwd )
144
- files = get_external_resources ( attributes , cwd )
142
+ files = get_external_resources ( module , cwd )
145
143
tuple = { beam , module , kind , source , compile , runtime , files , binary }
146
144
Agent . cast pid , & :lists . keystore ( beam , 1 , & 1 , tuple )
147
145
end
148
146
149
- defp detect_kind ( attributes ) do
147
+ defp detect_kind ( module ) do
150
148
cond do
151
- impl = attributes [ :impl ] ->
149
+ impl = Module . get_attribute ( module , :impl ) ->
152
150
{ :impl , impl [ :protocol ] }
153
- attributes [ :protocol ] ->
151
+ Module . get_attribute ( module , :protocol ) ->
154
152
:protocol
155
153
true ->
156
154
:module
157
155
end
158
156
end
159
157
160
- defp get_external_resources ( attributes , cwd ) do
161
- for { :external_resource , values } <- attributes ,
162
- file <- values ,
158
+ defp get_external_resources ( module , cwd ) do
159
+ for file <- Module . get_attribute ( module , :external_resource ) ,
163
160
File . regular? ( file ) ,
164
161
relative = Path . relative_to ( file , cwd ) ,
165
162
Path . type ( relative ) == :relative ,
0 commit comments