Skip to content

Commit

Permalink
chore: avoid using implicitly declared samples target in BUILD.bazel (#…
Browse files Browse the repository at this point in the history
…994)

* chore: avoid using implictly declared target

Now to include samples in the package we have to pass includeSamples = True in the build file such as:

java_gapic_assembly_gradle_pkg(
    name = "google-cloud-accessapproval-v1-java",
    deps = [
        ":accessapproval_java_gapic",
        ":accessapproval_java_grpc",
        ":accessapproval_java_proto",
        ":accessapproval_proto",
    ],
    includeSamples = True,
)

* use snake case
  • Loading branch information
eaball35 committed May 21, 2022
1 parent 9bbbede commit d9d3a18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gapic-generator-java/rules_java_gapic/java_gapic_pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ java_gapic_srcs_pkg = rule(
def java_gapic_assembly_gradle_pkg(
name,
deps,
include_samples = False,
assembly_name = None,
transport = None,
**kwargs):
Expand All @@ -341,9 +342,9 @@ def java_gapic_assembly_gradle_pkg(
processed_deps = {} #there is no proper Set in Starlark
for dep in deps:
# Use contains instead of endswith since microgenerator testing may use differently-named targets.
if "samples" in dep:
samples.append(dep)
elif "_java_gapic" in dep:
if "_java_gapic" in dep:
if include_samples:
samples.append(dep + "_samples")
_put_dep_in_a_bucket(dep, client_deps, processed_deps)
_put_dep_in_a_bucket("%s_test" % dep, client_test_deps, processed_deps)
_put_dep_in_a_bucket("%s_resource_name" % dep, proto_deps, processed_deps)
Expand Down

0 comments on commit d9d3a18

Please sign in to comment.