From 9d930295e32c6e36bbbf828255ce3b051275ab1f Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Fri, 25 Jun 2021 08:30:41 -0700 Subject: [PATCH] doc: link to @bazel_skylib//gazelle/bzl [skip ci] (#857) --- extend.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extend.rst b/extend.rst index 197089a7c..b4fc93f7e 100644 --- a/extend.rst +++ b/extend.rst @@ -14,8 +14,10 @@ Extending Gazelle .. _proto.Package: https://godoc.org/github.com/bazelbuild/bazel-gazelle/language/proto#Package .. _rules_r: https://github.com/grailbio/rules_r .. _rules_sass: https://github.com/bazelbuild/rules_sass -.. _#75: https://github.com/bazelbuild/rules_sass/pull/75 .. _bazel_rules_nodejs_contrib: https://github.com/ecosia/bazel_rules_nodejs_contrib#build-file-generation +.. _bazel-skylib: https://github.com/bazelbuild/bazel-skylib +.. _@bazel_skylib//gazelle/bzl: https://github.com/bazelbuild/bazel-skylib/tree/master/gazelle/bzl +.. _#75: https://github.com/bazelbuild/rules_sass/pull/75 .. _#803: https://github.com/bazelbuild/bazel-gazelle/issues/803 .. role:: cmd(code) @@ -35,7 +37,8 @@ To extend Gazelle, you must do three things: * Write a `go_library`_ with a function named ``NewLanguage`` that provides an implementation of the Language_ interface. This interface provides hooks for generating rules, parsing configuration directives, and resolving imports - to Bazel labels. + to Bazel labels. By convention, the library's package name should match + the language (for example, ``proto`` or ``bzl``). * Write a `gazelle_binary`_ rule. Include your library in the ``languages`` list. * Write a `gazelle`_ rule that points to your ``gazelle_binary``. When you run @@ -47,6 +50,8 @@ Supported languages Some extensions have been published by the community. +* `bazel-skylib`_ has an extension for generating ``bzl_library`` rules. + See `@bazel_skylib//gazelle/bzl`_. * `rules_sass`_ has an extension for generating ``sass_library`` and ``sass_binary`` rules (currently pending in PR `#75`_). * `rules_r`_ has an extension for generating rules for R package builds and