|
23 | 23 | src_dirs := [file:filename_all()],
|
24 | 24 | extra_src_dirs := [file:filename_all()],
|
25 | 25 | include_dirs := [file:filename_all()],
|
26 |
| - macros => [macro()], |
| 26 | + macros => macros(), |
27 | 27 | parse_transforms => [any()]}.
|
28 |
| --type macro() :: #{key := atom(), value => any()}. |
| 28 | +-type macros() :: #{atom() => any()}. |
29 | 29 | -type manifest() :: #{ apps := [app_context()],
|
30 | 30 | deps := [app_context()],
|
31 | 31 | otp_lib_dir := file:filename_all(),
|
@@ -133,7 +133,7 @@ adapt_context(App) ->
|
133 | 133 | src_dirs => [to_binary(D) || D <- SrcDirs],
|
134 | 134 | extra_src_dirs => [to_binary(D) || D <- ExtraSrcDirs],
|
135 | 135 | include_dirs => [to_binary(D) || D <- IncludeDirs],
|
136 |
| - macros => [to_macro(M) || M <- Macros], |
| 136 | + macros => to_macros(Macros), |
137 | 137 | parse_transforms => ParseTransforms}.
|
138 | 138 |
|
139 | 139 | -spec output_manifest(binary(), format(), string() | undefined) -> ok | {error, term()}.
|
@@ -169,11 +169,15 @@ format(_Manifest, Format) ->
|
169 | 169 | to_binary(Path) ->
|
170 | 170 | unicode:characters_to_binary(Path).
|
171 | 171 |
|
172 |
| --spec to_macro(atom() | {atom() | any()}) -> macro(). |
| 172 | +-spec to_macros(proplists:proplist()) -> macros(). |
| 173 | +to_macros(Macros) -> |
| 174 | + maps:from_list([to_macro(M) || M <- Macros]). |
| 175 | + |
| 176 | +-spec to_macro(atom() | {atom(), any()}) -> {atom(), any()}. |
173 | 177 | to_macro({Key, Value}) when is_atom(Key) ->
|
174 |
| - #{key => Key, value => Value}; |
| 178 | + {Key, Value}; |
175 | 179 | to_macro(Key) when is_atom(Key) ->
|
176 |
| - #{key => Key, value => true}. |
| 180 | + {Key, <<"true">>}. |
177 | 181 |
|
178 | 182 | -spec is_json_available() -> boolean().
|
179 | 183 | is_json_available() ->
|
|
0 commit comments