Skip to content

Commit

Permalink
fix: allow each language to specify how many components to skip while…
Browse files Browse the repository at this point in the history
… unpacking the tar file generated by bazel (#675)
  • Loading branch information
SurferJeffAtGoogle authored Jul 17, 2020
1 parent 21f1470 commit b8ff6a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions synthtool/gcp/gapic_bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def php_library(self, service: str, version: str, **kwargs) -> Path:
return self._generate_code(service, version, "php", **kwargs)

def java_library(self, service: str, version: str, **kwargs) -> Path:
return self._generate_code(service, version, "java", **kwargs)
return self._generate_code(
service, version, "java", tar_strip_components=0, **kwargs
)

def ruby_library(self, service: str, version: str, **kwargs) -> Path:
return self._generate_code(service, version, "ruby", **kwargs)
Expand All @@ -76,6 +78,7 @@ def _generate_code(
bazel_target: str = None,
include_protos: bool = False,
proto_output_path: Union[str, Path] = None,
tar_strip_components: int = 1,
):
# Determine which googleapis repo to use
if discogapic:
Expand Down Expand Up @@ -190,7 +193,7 @@ def _generate_code(
"tar",
"-C",
str(output_dir),
"--strip-components=1",
f"--strip-components={tar_strip_components}",
"-xzf",
tar_file,
]
Expand Down

0 comments on commit b8ff6a4

Please sign in to comment.