-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This obeys requested bindings from any module.
- Loading branch information
Showing
5 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
modules/googleapis/0.0.0-20240819-fe8ba054a.bcr.1/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,15 @@ | ||
module( | ||
name = "googleapis", | ||
version = "0.0.0-20240819-fe8ba054a.bcr.1", | ||
repo_name = "com_google_googleapis", | ||
) | ||
|
||
bazel_dep(name = "grpc", version = "1.66.0.bcr.2", repo_name = "com_github_grpc_grpc") | ||
bazel_dep(name = "grpc-java", version = "1.66.0", repo_name = "io_grpc_grpc_java") | ||
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") | ||
bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go") | ||
bazel_dep(name = "rules_proto", version = "5.3.0-21.7") | ||
bazel_dep(name = "rules_python", version = "0.31.0") | ||
|
||
switched_rules = use_extension("//:extensions.bzl", "switched_rules") | ||
use_repo(switched_rules, "com_google_googleapis_imports") |
72 changes: 72 additions & 0 deletions
72
modules/googleapis/0.0.0-20240819-fe8ba054a.bcr.1/patches/add_module_bazel.patch
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,72 @@ | ||
diff --git a/MODULE.bazel b/MODULE.bazel | ||
new file mode 100644 | ||
index 000000000..aab84dfce | ||
--- /dev/null | ||
+++ b/MODULE.bazel | ||
@@ -0,0 +1,15 @@ | ||
+module( | ||
+ name = "googleapis", | ||
+ version = "0.0.0-20240819-fe8ba054a.bcr.1", | ||
+ repo_name = "com_google_googleapis", | ||
+) | ||
+ | ||
+bazel_dep(name = "grpc", version = "1.66.0.bcr.2", repo_name = "com_github_grpc_grpc") | ||
+bazel_dep(name = "grpc-java", version = "1.66.0", repo_name = "io_grpc_grpc_java") | ||
+bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") | ||
+bazel_dep(name = "rules_go", version = "0.46.0", repo_name = "io_bazel_rules_go") | ||
+bazel_dep(name = "rules_proto", version = "5.3.0-21.7") | ||
+bazel_dep(name = "rules_python", version = "0.31.0") | ||
+ | ||
+switched_rules = use_extension("//:extensions.bzl", "switched_rules") | ||
+use_repo(switched_rules, "com_google_googleapis_imports") | ||
diff --git a/extensions.bzl b/extensions.bzl | ||
new file mode 100644 | ||
index 000000000..920f1a6f1 | ||
--- /dev/null | ||
+++ b/extensions.bzl | ||
@@ -0,0 +1,45 @@ | ||
+load(":repository_rules.bzl", "switched_rules_by_language") | ||
+ | ||
+_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): | ||
+ attrs = {} | ||
+ for module in ctx.modules: | ||
+ for t in module.tags.use_languages: | ||
+ attrs["cc"] = attrs.get("cc", False) or t.cc | ||
+ attrs["csharp"] = attrs.get("csharp", False) or t.csharp | ||
+ attrs["gapic"] = attrs.get("gapic", False) or t.gapic | ||
+ attrs["go"] = attrs.get("go", False) or t.go | ||
+ attrs["go_test"] = attrs.get("go_test", False) or t.go_test | ||
+ attrs["grpc"] = attrs.get("grpc", False) or t.grpc | ||
+ attrs["java"] = attrs.get("java", False) or t.java | ||
+ attrs["nodejs"] = attrs.get("nodejs", False) or t.nodejs | ||
+ attrs["php"] = attrs.get("php", False) or t.php | ||
+ attrs["python"] = attrs.get("python", False) or t.python | ||
+ attrs["ruby"] = attrs.get("ruby", False) or t.ruby | ||
+ | ||
+ switched_rules_by_language( | ||
+ name = "com_google_googleapis_imports", | ||
+ **attrs | ||
+ ) | ||
+ | ||
+switched_rules = module_extension( | ||
+ implementation = _switched_rules_impl, | ||
+ tag_classes = { | ||
+ "use_languages": _use_languages_tag, | ||
+ }, | ||
+) |
9 changes: 9 additions & 0 deletions
9
modules/googleapis/0.0.0-20240819-fe8ba054a.bcr.1/presubmit.yml
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,9 @@ | ||
matrix: | ||
platform: ["debian10", "macos", "ubuntu2004", "windows"] | ||
bazel: ["7.x"] | ||
tasks: | ||
verify_targets: | ||
platform: ${{ platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- '@googleapis//google/devtools/source/v1:source_proto' |
9 changes: 9 additions & 0 deletions
9
modules/googleapis/0.0.0-20240819-fe8ba054a.bcr.1/source.json
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,9 @@ | ||
{ | ||
"integrity": "sha256-BRPw9Ar2O9Bdx4nKzDNKts7CfMidtZZVfLLf6JGUY+Q=", | ||
"strip_prefix": "googleapis-fe8ba054ad4f7eca946c2d14a63c3f07c0b586a0", | ||
"url": "https://github.com/googleapis/googleapis/archive/fe8ba054ad4f7eca946c2d14a63c3f07c0b586a0.tar.gz", | ||
"patch_strip": 1, | ||
"patches": { | ||
"add_module_bazel.patch": "sha256-xNX4DWvxHEa7Bdt2sFyPmeZi27UJ7/l84I2OSUsTXdM=" | ||
} | ||
} |
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