Skip to content

Commit d04efdf

Browse files
committed
Also handle src/*.appup files
1 parent d33a2be commit d04efdf

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

erlang_app.bzl

Lines changed: 16 additions & 1 deletion
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(
@@ -120,7 +121,6 @@ def _erlang_app(
120121
)
121122

122123
beam_files = [":beam_files" if not test else ":test_beam_files"]
123-
beam_files += native.glob(["ebin/{}.appup".format(app_name)])
124124

125125
if len(native.glob(["ebin/{}.app".format(app_name)])) == 0:
126126
if not test:
@@ -145,6 +145,21 @@ def _erlang_app(
145145
else:
146146
app = "ebin/{}.app".format(app_name)
147147

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+
148163
if priv == None:
149164
priv = native.glob(
150165
["priv/**/*"],

gazelle/erlang_app_builder.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ func (builder *ErlangAppBuilder) AddFile(f string, genfile bool) {
9595
Path: f,
9696
IsGenFile: genfile,
9797
})
98-
} else if strings.HasSuffix(f, ".appup") {
99-
builder.Ebin.Add(&ErlangAppFile{
100-
Path: f,
101-
IsGenFile: genfile,
102-
})
10398
}
10499
} else if strings.HasPrefix(f, "src/") {
105100
if strings.HasSuffix(f, ".erl") {

0 commit comments

Comments
 (0)