Skip to content
Draft
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
2 changes: 0 additions & 2 deletions .bazeliskrc

This file was deleted.

2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build --protocopt=--experimental_allow_proto3_optional
common --noenable_bzlmod
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.1.0
8 changes: 8 additions & 0 deletions .github/workflows/bazel_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
build:
runs-on: ubuntu-24.04
container: gcr.io/gapic-images/googleapis:latest
env:
USE_BAZEL_VERSION: 5.4.1

steps:
- name: Checkout code
Expand Down Expand Up @@ -39,8 +41,14 @@ jobs:
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."

- name: Install Bazelisk
run: |
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 -o /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel

- name: Show bazel version
run: |
which -a bazel
bazel --version

- name: Build example package; all targets
Expand Down
28 changes: 14 additions & 14 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ http_archive(
],
)

# gRPC.
http_archive(
name = "com_github_grpc_grpc",
sha256 = "d5509e40fb24f6390deeef8a88668124f4ec77d2ebb3b1a957b235a2f08b70c0",
urls = ["https://github.com/grpc/grpc/archive/v1.64.0.tar.gz"],
strip_prefix = "grpc-1.64.0",
)

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

load("//:repositories.bzl", "gapic_generator_php_repositories")
gapic_generator_php_repositories()

Expand All @@ -45,17 +59,3 @@ switched_rules_by_language(
php = True,
)

# gRPC.
http_archive(
name = "com_github_grpc_grpc",
sha256 = "4b64cbc454cc4fd0801a2823111e1d99f519c765dfa116905740f7ca2256d085",
urls = ["https://github.com/grpc/grpc/archive/v1.51.1.zip"],
strip_prefix = "grpc-1.51.1",
)

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

1 change: 1 addition & 0 deletions bazel_example/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --noenable_bzlmod
1 change: 1 addition & 0 deletions bazel_example/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.1.0
15 changes: 8 additions & 7 deletions bazel_example/WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "com_google_protobuf",
sha256 = "f7042d540c969b00db92e8e1066a9b8099c8379c33f40f360eb9e1d98a36ca26",
strip_prefix = "protobuf-3.21.12",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.12.zip"],
sha256 = "4fc5ff1b2c339fb86cd3a25f0b5311478ab081e65ad258c6789359cd84d421f8",
strip_prefix = "protobuf-26.1",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v26.1.tar.gz"],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Expand All @@ -27,9 +27,9 @@ protobuf_deps()

http_archive(
name = "com_github_grpc_grpc",
sha256 = "4b64cbc454cc4fd0801a2823111e1d99f519c765dfa116905740f7ca2256d085",
strip_prefix = "grpc-1.51.1",
urls = ["https://github.com/grpc/grpc/archive/v1.51.1.zip"],
sha256 = "d5509e40fb24f6390deeef8a88668124f4ec77d2ebb3b1a957b235a2f08b70c0",
strip_prefix = "grpc-1.64.0",
urls = ["https://github.com/grpc/grpc/archive/v1.64.0.tar.gz"],
)

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
Expand All @@ -50,10 +50,11 @@ http_archive(
],
)

_rules_gapic_version = "0.5.4"
_rules_gapic_version = "1.0.0"

http_archive(
name = "rules_gapic",
sha256 = "c21e78a42f69898e7c3142fa837e3a637b1993d27c08a64723262611971d2b96",
strip_prefix = "rules_gapic-%s" % _rules_gapic_version,
urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version],
)
Expand Down
16 changes: 6 additions & 10 deletions repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//rules_php_gapic:php_repo.bzl", "php", "php_composer_install")

def gapic_generator_php_repositories():
_rules_gapic_version = "0.5.4"
_rules_gapic_version = "1.0.0"
maybe(
http_archive,
name = "rules_gapic",
sha256 = "c21e78a42f69898e7c3142fa837e3a637b1993d27c08a64723262611971d2b96",
strip_prefix = "rules_gapic-%s" % _rules_gapic_version,
urls = ["https://github.com/googleapis/rules_gapic/archive/v%s.tar.gz" % _rules_gapic_version],
)
Expand All @@ -41,20 +42,15 @@ def gapic_generator_php_repositories():
composer_json = "@gapic_generator_php//:composer.json",
)

# Import Bazel-only dependencies.
_protobuf_version = "3.13.0"
maybe(
http_archive,
name = "com_google_protobuf",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % _protobuf_version],
strip_prefix = "protobuf-%s" % _protobuf_version,
)

maybe(
http_archive,
name = "com_google_googleapis",
strip_prefix = "googleapis-9841522f92c6542aad0049d98721cba04f541f29",
urls = [
"https://github.com/googleapis/googleapis/archive/9841522f92c6542aad0049d98721cba04f541f29.zip",
],
patch_cmds = [
"find . -name BUILD.bazel -exec sed -i '1i exports_files(glob([\"*.json\", \"*.yaml\"]))' {} +",
"find . -name BUILD -exec sed -i '1i exports_files(glob([\"*.json\", \"*.yaml\"]))' {} +",
],
)
Loading