Skip to content

Commit cebdcb9

Browse files
authored
Merge pull request #192 from rabbitmq/refine-dot-app-logic
Correct the contents of 'registered' key in .app files
2 parents 6b61a28 + 5cfd7cc commit cebdcb9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

private/app_file.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ def _impl(ctx):
2121
src = ""
2222

2323
app_module = ctx.attr.app_module if ctx.attr.app_module != "" else ctx.attr.app_name + "_app"
24-
if len([m for m in ctx.files.modules if m.basename == app_module + ".beam"]) != 1:
25-
app_module = ""
26-
27-
modules = "[" + ",".join([_module_name(m) for m in ctx.files.modules]) + "]"
28-
29-
if len(ctx.attr.app_registered) > 0:
24+
if len([m for m in ctx.files.modules if m.basename == app_module + ".beam"]) > 0:
3025
registered_list = "[" + ",".join([ctx.attr.app_name + "_sup"] + ctx.attr.app_registered) + "]"
3126
else:
27+
app_module = ""
28+
if len(ctx.attr.app_registered) > 0:
29+
fail(app_module, "is not present, but app_registered was provided.")
3230
registered_list = ""
3331

32+
modules = "[" + ",".join([_module_name(m) for m in ctx.files.modules]) + "]"
33+
3434
applications_list = ""
3535
if src == "" or len(ctx.attr.extra_apps) > 0 or len(ctx.attr.deps) > 0:
3636
applications = ["kernel", "stdlib"] + ctx.attr.extra_apps
@@ -52,7 +52,7 @@ def _impl(ctx):
5252
if [ -n "{src}" ]; then
5353
cp {src} {out}
5454
else
55-
echo "{{application,'{name}',[{{registered, ['{name}_sup']}},{{env, []}}]}}." > {out}
55+
echo "{{application,'{name}',[{{registered, []}},{{env, []}}]}}." > {out}
5656
fi
5757
5858
if [ -n '{description}' ]; then

0 commit comments

Comments
 (0)