Skip to content

Commit 977bcdb

Browse files
authored
Get rid of BUILD.in generation (#156)
1 parent 25e97ca commit 977bcdb

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

pb-jelly-gen/codegen/codegen.py

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,11 +1836,6 @@ def mod_tree_dfs(
18361836
content = RS_HEADER + LIB_RS_HEADER + librs.content.getvalue()
18371837
yield filename, content
18381838

1839-
def get_build_file(self) -> Iterator[Tuple[Text, Text]]:
1840-
for crate in self.deps_map:
1841-
build_file = BUILD_TEMPLATE.format(crate=crate)
1842-
yield crate, build_file
1843-
18441839
def get_spec_toml_file(
18451840
self, derive_serde: bool, include_sso: bool
18461841
) -> Iterator[Tuple[Text, Text]]:
@@ -1928,23 +1923,6 @@ def crate_from_proto_filename(
19281923
return crate_name, mod_parts[1:]
19291924

19301925

1931-
BUILD_TEMPLATE = """
1932-
package(default_visibility = ["//visibility:public"])
1933-
1934-
rust_library(
1935-
name = "{crate}",
1936-
crate_type = "lib",
1937-
edition = "2018",
1938-
)
1939-
1940-
1941-
rust_doc(
1942-
name = "{crate}_doc",
1943-
crate = ":{crate}",
1944-
edition = "2018",
1945-
)
1946-
"""
1947-
19481926
SPEC_TOML_TEMPLATE = (
19491927
"""# @"""
19501928
+ """generated, do not edit
@@ -2079,10 +2057,11 @@ def add_mod(writer: CodeWriter) -> None:
20792057
output.content = content
20802058

20812059
if "generate_build_files" in request.parameter:
2082-
for crate, build_file in ctx.get_build_file():
2060+
for crate in ctx.deps_map:
2061+
# Create a stub file for later generation
20832062
output = response.file.add()
20842063
output.name = file_prefix + crate + "/BUILD.in-gen-proto~"
2085-
output.content = build_file
2064+
output.content = ""
20862065
elif "generate_spec_toml" in request.parameter:
20872066
for crate, spec_toml_file in ctx.get_spec_toml_file(derive_serde, include_sso):
20882067
output = response.file.add()

0 commit comments

Comments
 (0)