Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'recursive' option #1382

Merged
merged 1 commit into from
Nov 25, 2016
Merged

Add 'recursive' option #1382

merged 1 commit into from
Nov 25, 2016

Conversation

sirihansen
Copy link
Contributor

@sirihansen sirihansen commented Nov 21, 2016

This pull request adds the option {recursive,boolean()}, indicating whether or not rebar3 should search recursively for source files to compile. The options can be set on two levels:

top level - sets the default for the project:
{erlc_compiler,[{recursive,boolean()}]}.

per source directory:
{src_dirs,[{"src",[{recursive,boolean()}]}]}.
{extra_src_dirs,[{"test",[{recursive,boolean()}]}]}.

The variants are chosen after the discussion in issue #1345.

This feature is needed for testing of split-out applications from erlang/OTP, where data dirs (*_SUITE_data) in test contain .erl files that must not be compiled by rebar3. Reasons for this can be

a) the files should not be compiled at all, e.g. because the test suite operates on the .erl files.
b) the files must be compiled with specific options which shall not be applied to other source files (e.g. specific output directories)

For b) we need to let the test suite itself do the compilation. Earlier this was solved with a Makefile and some internal code in our test environment, but we are probably aiming at removing this.

The option {recursive,boolean()} can now be set pr directory in
'src_dirs' and 'extra_src_dirs', and on top level in the new
'erlc_compiler' option. Example config:

{erlc_compiler,[{recursive,false}]}.
{src_dirs,[{"src",[{recursive,true}]}]}.

This will cause recursive compilation within the "src" directory, but
not in any other directoires.
@ferd ferd added the OTP demand from the OTP team label Nov 23, 2016
@talentdeficit
Copy link
Contributor

this looks good to me, but i'm gonna leave it open for @ferd or @tsloughter to give final approval

@ferd
Copy link
Collaborator

ferd commented Nov 24, 2016

I think it looks clean too. The only thing I want to check before merging it is if any of the common plugins we have (and even rebar3 internals) use the opts to get the src_dir or extra_src_diroption literally instead of therebar_dir`; those would risk breaking with options being supported, and it could be a good service from us to raise a warning and quickly substitute calls. This is external to this PR, though.

@ferd
Copy link
Collaborator

ferd commented Nov 24, 2016

A quick ack check seems to say that rebar3 itself looks good with it.

@ferd
Copy link
Collaborator

ferd commented Nov 25, 2016

rebar3_eqc and rebar3_proper do some raw manipulation (similar to what eunit and CT were doing) but should be safe-ish I think. Mostly keydelete or adding entries. Sounds like this is good to merge. Sorry for the delays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OTP demand from the OTP team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants