From 3337db57c68666df920703176edcf8289976c7dc Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Wed, 6 Jan 2016 10:36:40 -0500 Subject: 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. --- src/rlx_prv_archive.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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. + -- cgit v1.2.3