Features
go_repository
replacesnew_go_repository
for dependencies with
and without BUILD or BUILD.bazel files.go_repository
will
generate these files using Gazelle if they are not already present.- Import paths may be specified explicitly using the
importpath
in
go_library
. This allows for Go subtrees that aren't at the top of
a repository. It also allows flat BUILD files. - Gazelle generates BUILD files for multiple platforms. Sources with
build constraints (tags or filename suffixes) and dependencies
imported from them are now compiled conditionally usingselect
. - Link stamping in multiple packages is now supported via the
x_defs
attribute.x_defs
may now contain values wrapped in braces (for
example:{VAR}
) which are replaced with values from the workspace
status files. - Rules are substantially cleaned up and organized. Assemble, compile,
and link actions are rewritten in Go, avoiding incompatibilities and
quoting problems with Bash. - Preliminary support for toolchains.
Bug fixes
cgo_library
now allows sources in multiple directories.cgo_library
no longer assumessrcs
is a list (it can now include
select
calls).go_binary
andgo_test
no longer expose .a files in outputs.- All rules now allow target names with slashes.
- If multiple packages are present after applying build constraints,
Gazelle will generate BUILD files for the package matching the
directory name. If there is no match, Gazelle will report an error. - Gazelle is much faster when running in external mode on repositories
with lots of external dependencies. - Gazelle no longer removes
# keep
comments from existing sources. - Many more...