Skip to content

Commit

Permalink
doc: link to @bazel_skylib//gazelle/bzl [skip ci] (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Conrod authored Jun 25, 2021
1 parent 15828e8 commit 9d93029
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions extend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9d93029

Please sign in to comment.