Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
comius authored Mar 17, 2024
1 parent cf3179d commit 230ea56
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions closure/webfiles/web_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ load(
"extract_providers",
"long_path",
"unfurl",
"collect_runfiles",
)

def _web_library(ctx):
Expand All @@ -41,12 +42,12 @@ def _web_library(ctx):
fail("when \"*\" is suppressed no other items should be present")

# process what came before
deps = unfurl(ctx.attr.deps, provider = WebFilesInfo)
deps = unfurl(extract_providers(ctx.attr.deps, provider = WebFilesInfo))
webpaths = []
manifests = []
for dep in deps:
webpaths.append(dep[WebFilesInfo].webpaths)
manifests.append(dep[WebFilesInfo].manifests)
webpaths.append(dep.webpaths)
manifests.append(dep.manifests)

# process what comes now
new_webpaths = []
Expand Down Expand Up @@ -104,13 +105,11 @@ def _web_library(ctx):
args.append(category)
inputs.extend(ctx.files.srcs)
for dep in deps:
inputs.append(dep[WebFilesInfo].dummy)
for f in dep.files.to_list():
inputs.append(f)
direct_manifests.append(dep[WebFilesInfo].manifest)
inputs.append(dep[WebFilesInfo].manifest)
inputs.append(dep.dummy)
direct_manifests.append(dep.manifest)
inputs.append(dep.manifest)
args.append("--direct_dep")
args.append(dep[WebFilesInfo].manifest.path)
args.append(dep.manifest.path)
for man in difference(manifests, depset(direct_manifests)):
inputs.append(man)
args.append("--transitive_dep")
Expand Down Expand Up @@ -148,22 +147,18 @@ def _web_library(ctx):
),
)

transitive_runfiles = depset(
transitive = [ctx.attr.server.data_runfiles.files] +
[dep.data_runfiles.files for dep in deps],
)

return [
DefaultInfo(
files = depset([ctx.outputs.executable, ctx.outputs.dummy]),
runfiles = ctx.runfiles(
runfiles = collect_runfiles(
ctx,
files = ctx.files.srcs + ctx.files.data + [
manifest,
params_file,
ctx.outputs.executable,
ctx.outputs.dummy,
],
transitive_files = transitive_runfiles,
extra_runfiles_attrs = ["server", "exports"],
),
),
WebFilesInfo(
Expand Down

0 comments on commit 230ea56

Please sign in to comment.