Skip to content

Commit

Permalink
Remove legacy proto code for Bazel < 0.21 (#3099)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsauer authored Apr 3, 2022
1 parent 466437c commit 451f267
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions proto/compiler.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,6 @@ def proto_path(src, proto):
Returns:
An import path string.
"""
if not hasattr(proto, "proto_source_root"):
# Legacy path. Remove when Bazel minimum version >= 0.21.0.
path = src.path
root = src.root.path
ws = src.owner.workspace_root
if path.startswith(root):
path = path[len(root):]
if path.startswith("/"):
path = path[1:]
if path.startswith(ws):
path = path[len(ws):]
if path.startswith("/"):
path = path[1:]
return path

if proto.proto_source_root == ".":
# true if proto sources were generated
prefix = src.root.path + "/"
Expand Down

0 comments on commit 451f267

Please sign in to comment.