Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
oncilla committed Oct 31, 2023
1 parent 28ec322 commit 5bd83ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 31 deletions.
16 changes: 3 additions & 13 deletions private/mgmtapi/api.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,17 @@ def openapi_generate_go(
**kwargs: Ad.
"""

_openapi_generate_go(
name = name + "_gen",
out_client = "client.bzl.gen.go" if client else None,
out_server = "server.bzl.gen.go" if server else None,
out_spec = "spec.bzl.gen.go" if spec else None,
out_types = "types.bzl.gen.go" if types else None,
**kwargs
)

out_files = []
write_files = {}
for typ, gen in {"client": client, "server": server, "spec": spec, "types": types}.items():
if not gen:
continue
src = typ + ".bzl.gen.go"
out_files.append(src)
kwargs["out_" + typ] = typ + ".bzl.gen.go"
write_files[typ + ".gen.go"] = src

native.filegroup(
_openapi_generate_go(
name = name,
srcs = out_files,
**kwargs
)

write_source_files(
Expand Down
7 changes: 1 addition & 6 deletions rules_openapi/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ def openapi_bundle(
name = name,
srcs = [name + "-no-header"],
outs = [name + ".bzl.gen.yml"],
cmd = "$(location @com_github_scionproto_scion//rules_openapi/internal:header.sh) \
'$(location " + name + "-no-header)' \
'$(location " + name + ".bzl.gen.yml)' \
'# GENERATED FILE DO NOT EDIT' \
",
tools = ["@com_github_scionproto_scion//rules_openapi/internal:header.sh"],
cmd = "(echo '# GENERATED FILE DO NOT EDIT'; cat $<) > $@",
visibility = visibility,
)

Expand Down
12 changes: 0 additions & 12 deletions rules_openapi/internal/header.sh

This file was deleted.

0 comments on commit 5bd83ad

Please sign in to comment.