bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.

APACHE-2.0 License

Stars
1.2K
Committers
158

Bot releases are hidden (Show)

bazel-gazelle - v0.38.0 Latest Release

Published by tyler-french 3 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.37.0...v0.38.0

bazel-gazelle - v0.37.0

Published by tyler-french 5 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.36.0...v0.37.0

bazel-gazelle - v0.36.0

Published by tyler-french 7 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.35.0...v0.36.0

bazel-gazelle - v0.35.0

Published by tyler-french 10 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.34.0...v0.35.0

bazel-gazelle - v0.34.0

Published by tyler-french 12 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.33.0...v0.34.0

bazel-gazelle - v0.33.0

Published by fmeum about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.32.0...v0.33.0

bazel-gazelle - v0.32.0

Published by linzhp over 1 year ago

Starting this release, Gazelle no longer resolves Go and proto imports of Google APIs to @go_googleapis. Instead, Go packages from Google APIs will be treated as regular Go packages, and resolve to @org_golang_google_genproto, which contains the pre-generated Go code, with its version determined by Go modules. For proto files importing Google APIs proto and generating Go code, users need to:

  1. Add an http_archive rule to download Google APIs, e.g.,
http_archive(
    name = "googleapis",
    sha256 = "9d1a930e767c93c825398b8f8692eca3fe353b9aaadedfbcf1fca2282c85df88",
    strip_prefix = "googleapis-64926d52febbf298cb82a8f472ade4a3969ba922",
    urls = [
        "https://github.com/googleapis/googleapis/archive/64926d52febbf298cb82a8f472ade4a3969ba922.zip",
    ],
)

load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
    name = "com_google_googleapis_imports",
)

Note that the version of Google APIs archive needs to be compatible with the pre-generated code in @org_golang_google_genproto.

  1. Resolve the proto manually. If Gazelle is being used, directives like the following need to be added to a parent directory of the proto files:
# gazelle:resolve proto proto google/rpc/status.proto @googleapis//google/rpc:status_proto
# gazelle:resolve proto go google/rpc/status.proto  @org_golang_google_genproto//googleapis/rpc/status
# gazelle:resolve proto google/longrunning/operations.proto @googleapis//google/longrunning:operations_proto
# gazelle:resolve proto go google/longrunning/operations.proto @org_golang_google_genproto//googleapis/longrunning

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.31.1...v0.32.0

bazel-gazelle - v0.31.1

Published by linzhp over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.31.0...v0.31.1

bazel-gazelle - v0.31.0

Published by linzhp over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.30.0...v0.31.0

bazel-gazelle - v0.30.0

Published by linzhp over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.29.0...v0.30.0

bazel-gazelle - v0.29.0

Published by linzhp almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.28.0...v0.29.0

bazel-gazelle - v0.28.0

Published by linzhp almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.27.0...v0.28.0

bazel-gazelle - v0.27.0

Published by linzhp about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.26.0...v0.27.0

bazel-gazelle - v0.26.0

Published by linzhp over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.25.0...v0.26.0

WORKSPACE code

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_gazelle",
    sha256 = "501deb3d5695ab658e82f6f6f549ba681ea3ca2a5fb7911154b5aa45596183fa",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
# The first declaration of an external repository "wins".
############################################################

gazelle_dependencies()
bazel-gazelle - v0.25.0

Published by blico over 2 years ago

Go changes

Proto changes

General changes

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.24.0...v0.25.0

WORKSPACE code

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_gazelle",
    sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
# The first declaration of an external repository "wins".
############################################################

gazelle_dependencies()
bazel-gazelle - v0.24.0

Published by robfig about 3 years ago

This release requires rules_go 0.29 to support the retirement of go_tool_library.

IMPORTANT

This release includes many new dependencies. Please be sure that your own workspace's dependencies are declared PRIOR to gazelle_dependencies(), or else they may be overridden. See the prompt block comment in the boilerplate below.

Changes

  • .netrc files are now supported for authenticated access for go_repository rules (#1090)
  • There is now a Gazelle extension for authoring BUILD files for the R language, using rules_r.

Fixes

Full Changelog: https://github.com/bazelbuild/bazel-gazelle/compare/v0.23.0...v0.24.0

WORKSPACE code

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_gazelle",
    sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

############################################################
# Define your own dependencies here using go_repository.
# Else, dependencies declared by rules_go/gazelle will be used.
# The first declaration of an external repository "wins".
############################################################

gazelle_dependencies()
bazel-gazelle - v0.23.0

Published by jayconrod over 3 years ago

Changes

  • Go
    • CXXFLAGS and CPPFLAGS #cgo directives are separated into cxxopts and cppopts attributes, respectively. Thanks @otan.
    • Dependencies on mapped kinds are now supported. Thanks @robfig.
    • The gazelle rule now supports the update-repos command.
    • The gazelle rule now has a data attribute and expands $(location) within arguments.
    • go_repository's build_naming_convention is now considered when resolving external dependencies. If a repository already has build files, this attribute may be set to indicate which naming convention it follows.
    • embedsrcs attributes are generated for packages that contain //go:embed directives.
  • Protobuf
    • proto_strip_import_prefix may be set in the root build file. Thanks @linzhp.

WORKSPACE code

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "bazel_gazelle",
    sha256 = "62ca106be173579c0a167deb23358fdfe71ffa1e4cfdddf5582af26520f1c66f",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.23.0/bazel-gazelle-v0.23.0.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

gazelle_dependencies()
bazel-gazelle - v0.22.3

Published by jayconrod almost 4 years ago

Bug fixes

  • -mode=diff treats empty build files correctly. (thanks @vpanta)
  • Gazelle should walk subdirectories more quickly when indexing is disabled. (thanks @blico)
  • Fixed dependency resolution with mapped kinds. (thanks @robfig)
  • Compatibility fixes for Go 1.16.

WORKSPACE code

http_archive(
    name = "bazel_gazelle",
    sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
bazel-gazelle - v0.22.2

Published by jayconrod about 4 years ago

Compatibility

  • Gazelle no longer depends on the deprecated go_rule function from rules_go, which will be removed in 0.25. This should improve compatibility with future versions.

WORKSPACE code

http_archive(
    name = "bazel_gazelle",
    sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
bazel-gazelle - v0.22.1

Published by jayconrod about 4 years ago

Bug fixes

Go

  • The version of rules_go may now be inferred from WORKSPACE if the repository io_bazel_rules_go hasn't been fetched yet.
  • The gazelle_binary rule should now work correctly with previous versions of rules_go.
  • In the import and import_alias naming conventions, dots will be replaced with underscores in generated test names. This avoids generating targets that have the same names as source files.
  • update-repos -from_file=go.mod should no longer fail mysteriously when go.mod has a replace directive that uses a relative path. Local replacements are still not supported though. (thanks @dragonsinth)

WORKSPACE code

http_archive(
    name = "bazel_gazelle",
    sha256 = "72d339ff874a382f819aaea80669be049069f502d6c726a07759fdca99653c48",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.1/bazel-gazelle-v0.22.1.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.1/bazel-gazelle-v0.22.1.tar.gz",
    ],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()