Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ggj][bazel] fix: new repo bazel name #340

Merged
merged 2 commits into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
workspace(name = "com_google_api_generator")
workspace(name = "gapic_generator_java")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand All @@ -14,17 +14,17 @@ http_archive(
],
)

load("//:repository_rules.bzl", "com_google_api_generator_properties")
load("//:repository_rules.bzl", "gapic_generator_java_properties")

com_google_api_generator_properties(
name = "com_google_api_generator_properties",
gapic_generator_java_properties(
name = "gapic_generator_java_properties",
file = "//:dependencies.properties",
)

load("@com_google_api_generator_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:repositories.bzl", "com_google_api_generator_repositories")
load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")
load("//:repositories.bzl", "gapic_generator_java_repositories")

com_google_api_generator_repositories()
gapic_generator_java_repositories()

# protobuf
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Expand Down
4 changes: 2 additions & 2 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@com_google_api_generator_properties//:dependencies.properties.bzl", "PROPERTIES")
load("@gapic_generator_java_properties//:dependencies.properties.bzl", "PROPERTIES")

def com_google_api_generator_repositories():
def gapic_generator_java_repositories():
# Import dependencies shared between Gradle and Bazel (i.e. maven dependencies)
for name, artifact in PROPERTIES.items():
_maybe(
Expand Down
6 changes: 3 additions & 3 deletions repository_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

def _com_google_api_generator_properties_impl(ctx):
def _gapic_generator_java_properties_impl(ctx):
props_path = ctx.path(ctx.attr.file)
result = ctx.execute(["cat", props_path])

Expand Down Expand Up @@ -40,8 +40,8 @@ PROPERTIES = {props_as_map}
ctx.file("BUILD.bazel", "")
ctx.file("%s.bzl" % props_name, dependencies_bzl)

com_google_api_generator_properties = repository_rule(
implementation = _com_google_api_generator_properties_impl,
gapic_generator_java_properties = repository_rule(
implementation = _gapic_generator_java_properties_impl,
attrs = {
"file": attr.label(),
},
Expand Down
2 changes: 1 addition & 1 deletion rules_java_gapic/java_gapic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def java_gapic_library(
proto_custom_library(
name = raw_srcjar_name,
deps = srcs,
plugin = Label("@com_google_api_generator//:protoc-gen-%s" % _java_generator_name),
plugin = Label("@gapic_generator_java//:protoc-gen-%s" % _java_generator_name),
plugin_file_args = {},
opt_file_args = file_args_dict,
output_type = _java_generator_name,
Expand Down