Skip to content

Commit

Permalink
build(issue-84): migrated to bazel modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaba505 committed May 16, 2024
1 parent c0cdd72 commit c895a9d
Show file tree
Hide file tree
Showing 19 changed files with 3,337 additions and 1,043 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
common --enable_bzlmod

build --show_timestamps

test --test_output=errors
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.0
7.1.2
14 changes: 0 additions & 14 deletions BUILD

This file was deleted.

5 changes: 5 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
load("@gazelle//:def.bzl", "gazelle")

# gazelle:proto disable_global
# gazelle:prefix github.com/z5labs/megamind
gazelle(name = "gazelle")
45 changes: 45 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module(name = "com_github_z5labs_megamind")

bazel_dep(name = "gazelle", version = "0.36.0")
bazel_dep(name = "rules_go", version = "0.47.1")
bazel_dep(name = "rules_oci", version = "1.7.5")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.7.3")

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.22.2")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")

# See https://github.com/bazelbuild/rules_go/issues/3625#issuecomment-1674275131
# go_deps.gazelle_override(
# path = "github.com/googleapis/gax-go/v2",
# directives = [
# "gazelle:proto disable",
# ]
# )

# All *direct* Go dependencies of the module have to be listed explicitly.
use_repo(
go_deps,
"com_github_gin_gonic_gin",
"com_github_spf13_cobra",
"com_github_spf13_viper",
"com_github_stretchr_testify",
"org_golang_google_grpc",
"org_golang_google_protobuf",
"org_golang_x_sync",
"org_uber_go_zap",
)

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

oci.pull(
name = "distroless_base",
image = "gcr.io/distroless/base",
digest = "sha256:ccaef5ee2f1850270d453fdf700a5392534f8d1a8ca2acda391fbb6a06b81c86",
platforms = ["linux/amd64", "linux/arm64"],
)

use_repo(oci, "distroless_base")
Loading

0 comments on commit c895a9d

Please sign in to comment.