-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add googleapis 0.0.0-20241220-5e258e33
- Loading branch information
Showing
34 changed files
with
431 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module( | ||
name = "googleapis-cc", | ||
version = "0.1.0", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") | ||
bazel_dep(name = "protobuf", version = "27.0") | ||
|
||
switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") | ||
switched_rules.register( | ||
name = "cc_proto_library", | ||
file = "@protobuf//bazel:cc_proto_library.bzl", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", | ||
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", | ||
"overlay": { | ||
"MODULE.bazel": "sha256-4GPXxlFen3Atai6EyboC87iGAPuNSpfBBmwnMQbayqc=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"homepage": "https://github.com/googleapis/googleapis", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"name": "No Maintainer Specified" | ||
} | ||
], | ||
"repository": [ | ||
"github:googleapis/googleapis" | ||
], | ||
"versions": [ | ||
"0.1.0" | ||
], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module( | ||
name = "googleapis-go", | ||
version = "0.1.0", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") | ||
bazel_dep(name = "rules_go", version = "0.50.1") | ||
|
||
switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") | ||
switched_rules.register( | ||
name = "go_proto_library", | ||
file = "@rules_go//proto:def.bzl", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", | ||
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", | ||
"overlay": { | ||
"MODULE.bazel": "sha256-GUjZBV62PY/o9joplOGrL6pIIASpyqWnhns27+JUCts=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"homepage": "https://github.com/googleapis/googleapis", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"name": "No Maintainer Specified" | ||
} | ||
], | ||
"repository": [ | ||
"github:googleapis/googleapis" | ||
], | ||
"versions": [ | ||
"0.1.0" | ||
], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module( | ||
name = "googleapis-java", | ||
version = "0.1.0", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") | ||
bazel_dep(name = "protobuf", version = "27.0") | ||
|
||
switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") | ||
switched_rules.register( | ||
name = "java_proto_library", | ||
file = "@protobuf//bazel:java_proto_library.bzl", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", | ||
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", | ||
"overlay": { | ||
"MODULE.bazel": "sha256-eU1okw/B5a/szrR9RY4J489YrHyiYkbZ3uSsxa7/i+4=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"homepage": "https://github.com/googleapis/googleapis", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"name": "No Maintainer Specified" | ||
} | ||
], | ||
"repository": [ | ||
"github:googleapis/googleapis" | ||
], | ||
"versions": [ | ||
"0.1.0" | ||
], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module( | ||
name = "googleapis-python", | ||
version = "0.1.0", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") | ||
bazel_dep(name = "protobuf", version = "27.0") | ||
|
||
switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") | ||
switched_rules.register( | ||
name = "py_proto_library", | ||
file = "@protobuf//bazel:py_proto_library.bzl", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"integrity": "sha256-hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU=", | ||
"url": "https://github.com/fmeum/bazel-central-registry/releases/download/v1.0.0/empty.zip", | ||
"overlay": { | ||
"MODULE.bazel": "sha256-4Hlx29KheHuWdfrllIzz7aio1bHr7a2oe+VxNFPFoxM=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"homepage": "https://github.com/googleapis/googleapis", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"name": "No Maintainer Specified" | ||
} | ||
], | ||
"repository": [ | ||
"github:googleapis/googleapis" | ||
], | ||
"versions": [ | ||
"0.1.0" | ||
], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module( | ||
name = "googleapis", | ||
version = "0.0.0-20241220-5e258e33", | ||
repo_name = "com_google_googleapis", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "rules_proto", version = "5.3.0-21.7") | ||
|
||
switched_rules = use_extension("//private/extensions:switched_rules.bzl", "switched_rules") | ||
use_repo(switched_rules, "com_google_googleapis_imports") |
1 change: 1 addition & 0 deletions
1
modules/googleapis/0.0.0-20241220-5e258e33/overlay/MODULE.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
30 changes: 30 additions & 0 deletions
30
modules/googleapis/0.0.0-20241220-5e258e33/overlay/extensions.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
_use_languages_tag = tag_class( | ||
attrs = { | ||
"cc": attr.bool(default = False), | ||
"csharp": attr.bool(default = False), | ||
"gapic": attr.bool(default = False), | ||
"go": attr.bool(default = False), | ||
"go_test": attr.bool(default = False), | ||
"grpc": attr.bool(default = False), | ||
"java": attr.bool(default = False), | ||
"nodejs": attr.bool(default = False), | ||
"php": attr.bool(default = False), | ||
"python": attr.bool(default = False), | ||
"ruby": attr.bool(default = False), | ||
}, | ||
) | ||
|
||
def _switched_rules_impl(_ctx): | ||
fail(""" | ||
The 'switched_rules' extension is no longer supported due to problems inherent to its design. | ||
Instead, add 'bazel_dep(name = "googleapis-<lang>", version = "0.1.0")' to your MODULE.bazel file to use '<lang>_proto_library' targets in 'googleapis'. | ||
To see error messages with the exact 'bazel_dep's to add, remove the 'switched_rules' usage and build your project. | ||
The available individual modules can be found at https://registry.bazel.build/search?q=googleapis. | ||
""") | ||
|
||
switched_rules = module_extension( | ||
implementation = _switched_rules_impl, | ||
tag_classes = { | ||
"use_languages": _use_languages_tag, | ||
}, | ||
) |
Empty file.
44 changes: 44 additions & 0 deletions
44
modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/constants.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Maps rules used by googleapis to <flavor> if the rule is registered by the googleapis-<flavor> | ||
# module or to None if the rule is not supported yet. | ||
RULE_TO_FLAVOR = { | ||
"cc_gapic_library": None, | ||
"cc_grpc_library": None, | ||
"cc_proto_library": "cc", | ||
"csharp_gapic_assembly_pkg": None, | ||
"csharp_gapic_library": None, | ||
"csharp_grpc_library": None, | ||
"csharp_proto_library": None, | ||
"go_gapic_assembly_pkg": None, | ||
"go_gapic_library": None, | ||
"go_grpc_library": None, | ||
"go_library": None, | ||
"go_proto_library": "go", | ||
"go_test": None, | ||
"java_gapic_assembly_gradle_pkg": None, | ||
"java_gapic_library": None, | ||
"java_gapic_test": None, | ||
"java_grpc_library": None, | ||
"java_proto_library": "java", | ||
"moved_proto_library": None, | ||
"nodejs_gapic_assembly_pkg": None, | ||
"nodejs_gapic_library": None, | ||
"php_gapic_assembly_pkg": None, | ||
"php_gapic_library": None, | ||
"php_grpc_library": None, | ||
"php_proto_library": None, | ||
"proto_library_with_info": None, | ||
"py_gapic_assembly_pkg": None, | ||
"py_gapic_library": None, | ||
"py_grpc_library": None, | ||
"py_import": None, | ||
"py_proto_library": "python", | ||
"py_test": None, | ||
"ruby_ads_gapic_library": None, | ||
"ruby_cloud_gapic_library": None, | ||
"ruby_gapic_assembly_pkg": None, | ||
"ruby_grpc_library": None, | ||
"ruby_proto_library": None, | ||
} | ||
|
||
# The version of the googleapis-<flavor> modules to recommend to users. | ||
FLAVOR_VERSION = "0.1.0" |
12 changes: 12 additions & 0 deletions
12
modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/fail_macro.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
def _fail_rule_impl(ctx): | ||
fail(ctx.attr.message) | ||
|
||
_fail_rule = rule( | ||
implementation = _fail_rule_impl, | ||
attrs = { | ||
"message": attr.string(), | ||
}, | ||
) | ||
|
||
def make_fail_macro(message): | ||
return lambda name, **kwargs: _fail_rule(name = name, message = message) |
107 changes: 107 additions & 0 deletions
107
modules/googleapis/0.0.0-20241220-5e258e33/overlay/private/extensions/switched_rules.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
load(":constants.bzl", "FLAVOR_VERSION", "RULE_TO_FLAVOR") | ||
|
||
def _imports_impl(repo_ctx): | ||
loads = [ | ||
"""load("@com_google_googleapis//private/extensions:fail_macro.bzl", "make_fail_macro")""", | ||
] | ||
assignments = [] | ||
|
||
for name, file in repo_ctx.attr.rules.items(): | ||
if file: | ||
loads.append("""load("{file}", _{name} = "{name}")""".format( | ||
file = file, | ||
name = name, | ||
)) | ||
assignments.append("""{name} = _{name}""".format( | ||
name = name, | ||
)) | ||
else: | ||
flavor = RULE_TO_FLAVOR[name] | ||
if flavor: | ||
message = """Add 'bazel_dep(name = "googleapis-{flavor}", version = "{flavor_version}")' to your MODULE.bazel file to use '{name}' targets in 'googleapis'.""".format( | ||
flavor = flavor, | ||
flavor_version = FLAVOR_VERSION, | ||
name = name, | ||
) | ||
else: | ||
message = """'{name} targets in googleapis are not supported with Bzlmod. If you need them, please file an issue at https://github.com/bazelbuild/bazel-central-registry.""".format( | ||
name = name, | ||
) | ||
assignments.append("""{name} = make_fail_macro({message})""".format( | ||
name = name, | ||
message = repr(message), | ||
)) | ||
imports_content = "\n".join(loads + assignments) | ||
|
||
repo_ctx.file("BUILD.bazel") | ||
repo_ctx.file("imports.bzl", imports_content) | ||
|
||
_imports = repository_rule( | ||
implementation = _imports_impl, | ||
attrs = { | ||
# Maps a name to a file label in unambiguous form. | ||
"rules": attr.string_dict(), | ||
}, | ||
) | ||
|
||
def _io_bazel_rules_go_grpc_forwarder_impl(repo_ctx): | ||
content = "" | ||
if repo_ctx.attr.go_grpc_label: | ||
content = """\ | ||
alias( | ||
name = "go_grpc", | ||
actual = "{go_grpc_label}", | ||
visibility = ["//visibility:public"], | ||
) | ||
""".format(go_grpc_label = repo_ctx.attr.go_grpc_label) | ||
repo_ctx.file("proto/BUILD.bazel", content) | ||
|
||
_io_bazel_rules_go_grpc_forwarder = repository_rule( | ||
implementation = _io_bazel_rules_go_grpc_forwarder_impl, | ||
attrs = { | ||
"go_grpc_label": attr.string(), | ||
} | ||
) | ||
|
||
def _switched_rules_impl(module_ctx): | ||
rules = {name: "" for name in RULE_TO_FLAVOR.keys()} | ||
|
||
for module in module_ctx.modules: | ||
if module.name != "googleapis" and not module.name.startswith("googleapis-"): | ||
fail("This extension is internal to googleapis and cannot be accessed from " + module.name) | ||
for rule in module.tags.register: | ||
if rule.name not in rules: | ||
fail("Unknown rule: %s" % rule.name) | ||
if rules[rule.name]: | ||
fail("Rule %s already registered" % rule.name) | ||
rules[rule.name] = str(rule.file) | ||
|
||
_imports( | ||
name = "com_google_googleapis_imports", | ||
rules = rules, | ||
) | ||
|
||
go_grpc_label = "" | ||
go_proto_library_file = rules.get("go_proto_library") | ||
if go_proto_library_file: | ||
go_grpc_label = "@@{}//proto:go_grpc".format(Label(go_proto_library_file).workspace_name) | ||
_io_bazel_rules_go_grpc_forwarder( | ||
name = "io_bazel_rules_go", | ||
go_grpc_label = go_grpc_label, | ||
) | ||
|
||
return module_ctx.extension_metadata(reproducible = True) | ||
|
||
_register = tag_class( | ||
attrs = { | ||
"name": attr.string(), | ||
"file": attr.label(), | ||
}, | ||
) | ||
|
||
switched_rules = module_extension( | ||
implementation = _switched_rules_impl, | ||
tag_classes = { | ||
"register": _register, | ||
}, | ||
) |
1 change: 1 addition & 0 deletions
1
modules/googleapis/0.0.0-20241220-5e258e33/overlay/tests/bcr/.bazelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
common --java_runtime_version=remotejdk_11 |
Oops, something went wrong.