Skip to content

Commit bf4a54c

Browse files
authored
Merge pull request #196 from rabbitmq/handle-appup-by-default
Handle .appup by default
2 parents a373786 + d04efdf commit bf4a54c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

erlang_app.bzl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
12
load(":app_file.bzl", "app_file")
23
load(":erlang_bytecode.bzl", "erlang_bytecode")
34
load(
@@ -144,6 +145,21 @@ def _erlang_app(
144145
else:
145146
app = "ebin/{}.app".format(app_name)
146147

148+
if len(native.glob(["ebin/{}.appup".format(app_name)])) > 0:
149+
appup = "ebin/{}.appup".format(app_name)
150+
elif len(native.glob(["src/{}.appup".format(app_name)])) > 0:
151+
if not test:
152+
copy_file(
153+
name = "appup",
154+
src = "src/{}.appup".format(app_name),
155+
out = "ebin/{}.appup".format(app_name)
156+
)
157+
appup = ":appup"
158+
else:
159+
appup = None
160+
161+
beam_files += [appup] if appup != None else []
162+
147163
if priv == None:
148164
priv = native.glob(
149165
["priv/**/*"],

gazelle/erlang_app_builder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ func (builder *ErlangAppBuilder) AddFile(f string, genfile bool) {
9696
IsGenFile: genfile,
9797
})
9898
}
99-
// TODO: handle .appup files
10099
} else if strings.HasPrefix(f, "src/") {
101100
if strings.HasSuffix(f, ".erl") {
102101
builder.Srcs.Add(&ErlangAppFile{

0 commit comments

Comments
 (0)