简体   繁体   中英

Exclude module from compilation in rebar3

How can I exclude an Erlang module from compilation in rebar3?

It should be included or excluded based on profiles.

The solution is to add a rebar3 profile defining a macro in your rebar.config

{profiles, [{nomodulex, [
    {erl_opts, [{d, 'NO_MODX'}]}
    ]}
]}.

And in the module add straight after the module declaration -ifndef(NO_MODX). and in the end -endif.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM