diff options
author | Fred Hebert <[email protected]> | 2016-01-06 10:36:40 -0500 |
---|---|---|
committer | Fred Hebert <[email protected]> | 2016-01-06 10:36:40 -0500 |
commit | 3337db57c68666df920703176edcf8289976c7dc (patch) | |
tree | 38074284e3cd513eb91111a7a5ffe9fe331c3515 /src/rlx_prv_archive.erl | |
parent | dfebf6dbbab497b61190b8ea153af1ef2b4b7ee4 (diff) | |
download | relx-3337db57c68666df920703176edcf8289976c7dc.tar.gz relx-3337db57c68666df920703176edcf8289976c7dc.tar.bz2 relx-3337db57c68666df920703176edcf8289976c7dc.zip |
Include src/ in tarballs unless specified not to
By default, the `include_src` value is `true`, yet Relx disregards the
value entirely when generating tarballs.
This patch makes it so the value is used and respected when generating
tarballs. Given the default value is `true`, this patch changes the
default behaviour of relx to always include source files in tarballs,
considering its omission a bug rather than a feature.
Tests are added, verifying the impact on ERTS-included files.
Diffstat (limited to 'src/rlx_prv_archive.erl')
-rw-r--r-- | src/rlx_prv_archive.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rlx_prv_archive.erl b/src/rlx_prv_archive.erl index 1bc2f1b..e2d943f 100644 --- a/src/rlx_prv_archive.erl +++ b/src/rlx_prv_archive.erl @@ -67,7 +67,7 @@ make_tar(State, Release, OutputDir) -> Vsn = rlx_release:vsn(Release), ErtsVersion = rlx_release:erts(Release), Opts = [{path, [filename:join([OutputDir, "lib", "*", "ebin"])]}, - {dirs, [include]}, + {dirs, [include | maybe_src_dirs(State)]}, {outdir, OutputDir} | case rlx_state:get(State, include_erts, true) of true -> @@ -170,3 +170,10 @@ filter({template, _, _}) -> true; filter(_) -> false. + +maybe_src_dirs(State) -> + case rlx_state:get(State, include_src, true) of + false -> []; + true -> [src] + end. + |