github bazel-contrib/bazel-gazelle v0.22.0

latest releases: v0.40.0, v0.39.1, v0.39.0...
pre-release4 years ago

Changes

  • The Go extension can now generate targets with a new naming convention.
    • In new projects, by default, a library will be named foo if its import path ends with foo instead of go_default_library. Similarly, a test will be named foo_test instead of go_default_test.
    • Gazelle will attempt to detect the naming convention used in existing projects, so it shouldn't unexpectedly change the naming convention.
    • To specify the naming convention explicitly, use the # gazelle:go_naming_convention directive or the -go_naming_convention flag. Valid values are import, go_default_library, and import_alias. Gazelle will rename existing targets the next time it runs after a change.
    • go_repository uses the import_alias naming convention by default, so either the old or new names may be used.
    • Thanks to @tomlu for implementing this.
  • Added # gazelle:go_generate_proto directive, which instructs the Go extension whether to generate go_proto_library rules for proto_library generated by the proto extension (thanks @linzhp).
  • Improved Windows compatibility (thanks @tomlu).
  • Language extensions can now provide dependency resolution for other extensions by implementing the resolve.CrossResolver interface. This is now used for resolve proto imports in Go (thanks @blico).
  • In the update-repos command, the -build_directives flag may be used to set the build_directives attribute on generated repositories (thanks @Helcaraxan).
  • In the update-repos command, new rules and macros will be inserted higher in WORKSPACE, above go_rules_dependencies and gazelle_dependencies if possible, to make it easier to override indirect dependencies.

Compatibility

  • gazelle_binary no longer supports mode attributes such as goos, race, and gotags. These depended on internal implementation details in rules_go. If you need to build a gazelle_binary for a platform other than the host, use command-line flags such as --platforms and --@io_bazel_rules_go//go/config:race or use a transition.

WORKSPACE code

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

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

Don't miss a new bazel-gazelle release

NewReleases is sending notifications on new releases.