From 6cf35ec04fd4f6ed069a4b493c91850af58639f6 Mon Sep 17 00:00:00 2001 From: Rin Kuryloski Date: Mon, 12 Aug 2024 19:49:18 -0300 Subject: [PATCH] Only apply the default for app_src of erlang_app_sources if unset Previously the value was always overridden if the src/*.app.src file existed, which was incorrect --- erlang_app_sources.bzl | 8 ++++---- examples/basic/BUILD.bazel | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/erlang_app_sources.bzl b/erlang_app_sources.bzl index 2449e687..d2b812ce 100644 --- a/erlang_app_sources.bzl +++ b/erlang_app_sources.bzl @@ -12,10 +12,10 @@ def erlang_app_sources( priv = None, license_files = None, **kwargs): - - app_src_paths = native.glob(["src/%s.app.src" % app_name]) - if len(app_src_paths) == 1: - app_src = app_src_paths[0] + if app_src == None: + app_src_paths = native.glob(["src/%s.app.src" % app_name]) + if len(app_src_paths) == 1: + app_src = app_src_paths[0] if public_hdrs == None: public_hdrs = native.glob([ diff --git a/examples/basic/BUILD.bazel b/examples/basic/BUILD.bazel index 91480c3d..d9916cc5 100644 --- a/examples/basic/BUILD.bazel +++ b/examples/basic/BUILD.bazel @@ -44,7 +44,6 @@ erlc_opts_file( erlang_app_sources( name = "%s_srcs" % APP_NAME, app_name = APP_NAME, - app_src = ":app_src", erlc_opts_file = ":erlc_opts_file", visibility = ["//visibility:public"], ) @@ -52,7 +51,6 @@ erlang_app_sources( erlang_app_sources( name = "test_%s_srcs" % APP_NAME, app_name = APP_NAME, - app_src = ":app_src", erlc_opts_file = ":test_erlc_opts_file", visibility = ["//visibility:public"], )