-
Notifications
You must be signed in to change notification settings - Fork 353
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
Split googleapis into per-language modules #3472
Open
fmeum
wants to merge
9
commits into
main
Choose a base branch
from
fmeum/googleapis-0.0.0-20241220-5e258e33
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+542
−1
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8043e85
Add googleapis 0.0.0-20241220-5e258e33
fmeum c54877c
Fix presubmit
fmeum 39f6bb0
grpc-cc
fmeum dc9b6ba
Add grpc-java
fmeum cfedf9f
Reformat module files
fmeum 979ea95
Fix test module
fmeum 9161d5a
Drop googleapis-grpc-cc
fmeum 6617794
Add protobuf dep
fmeum bbd1d00
Add comments
fmeum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
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 @@ | ||
tasks: | ||
verify_targets: | ||
name: Empty test | ||
platform: ubuntu2404 | ||
bazel: 8.x | ||
build_flags: | ||
- "--nobuild" | ||
build_targets: | ||
- "//..." |
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-0t8JSjSK94lSCfY8NkTpv+I+/akmQIiNWGxmJE3grHQ=" | ||
} | ||
} |
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 |
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 @@ | ||
tasks: | ||
verify_targets: | ||
name: Empty test | ||
platform: ubuntu2404 | ||
bazel: 8.x | ||
build_flags: | ||
- "--nobuild" | ||
build_targets: | ||
- "//..." |
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-5BkG4nNFeIILQLDDXpVPuSJ2NACAspxl8CTjxkveT1o=" | ||
} | ||
} |
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-grpc-java", | ||
version = "0.1.0", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "googleapis", version = "0.0.0-20241220-5e258e33") | ||
bazel_dep(name = "grpc-java", version = "1.66.0") | ||
|
||
switched_rules = use_extension("@googleapis//private/extensions:switched_rules.bzl", "switched_rules") | ||
switched_rules.register( | ||
name = "java_grpc_library", | ||
file = "@grpc-java//:java_grpc_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 |
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 @@ | ||
tasks: | ||
verify_targets: | ||
name: Empty test | ||
platform: ubuntu2404 | ||
bazel: 8.x | ||
build_flags: | ||
- "--nobuild" | ||
build_targets: | ||
- "//..." |
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-6OS1YB5nWgVsNnucanTpPJ9n+eF2Xy2VS/sJF53lIs0=" | ||
} | ||
} |
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 |
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 @@ | ||
tasks: | ||
verify_targets: | ||
name: Empty test | ||
platform: ubuntu2404 | ||
bazel: 8.x | ||
build_flags: | ||
- "--nobuild" | ||
build_targets: | ||
- "//..." |
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-LCZExIuJd49TLk0a5I0dGzF0nOSIBSyQhvPOrIaV7+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 |
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 @@ | ||
tasks: | ||
verify_targets: | ||
name: Empty test | ||
platform: ubuntu2404 | ||
bazel: 8.x | ||
build_flags: | ||
- "--nobuild" | ||
build_targets: | ||
- "//..." |
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-fC+GNs2HlOkSgVnPLlwrnh2Y+ueI5YlwQRC4c8lcej0=" | ||
} | ||
} |
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,19 @@ | ||
module( | ||
name = "googleapis", | ||
version = "0.0.0-20241220-5e258e33", | ||
repo_name = "com_google_googleapis", | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
# Only needed for well-known protos. | ||
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") | ||
|
||
# Only needed for proto_library. | ||
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", | ||
"io_bazel_rules_go", | ||
) |
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 (some may never be). | ||
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": "grpc-java", | ||
"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) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Replace with a better source after #3474.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just allow url to be not set when overlay is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but that would require raising the minimum Bazel version to at least 8.1.0 (the earliest we can ship this).