mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
New crates are in https://crates.io/search?q=google-protobuf PiperOrigin-RevId: 963684439
11 lines
533 B
Python
11 lines
533 B
Python
"""A rule to textually replace {{VERSION}} with the Rust release version in files."""
|
|
|
|
load("//:protobuf_version.bzl", "PROTOBUF_LEGACY_RUST_VERSION", "PROTOBUF_RUST_VERSION")
|
|
|
|
def substitute_rust_release_version(src, out, name = None):
|
|
native.genrule(
|
|
name = name or ("gen_%s" % out),
|
|
srcs = [src],
|
|
outs = [out],
|
|
cmd = "cat $(SRCS) | sed -e 's/{{PROTOBUF_RUST_VERSION}}/{0}/g' -e 's/{{PROTOBUF_LEGACY_VERSION}}/{1}/g' > $(OUTS)".format(PROTOBUF_RUST_VERSION, PROTOBUF_LEGACY_RUST_VERSION),
|
|
)
|