123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- kazel - a BUILD file generator for go and bazel
- ===============================================
- Requirements:
- * Your project must be somewhat compatible with go tool because
- kazel uses go tool to parse your import tree.
- * You must have a **GOPATH** and **GOROOT** setup and your project must
- be in the correct location in your **GOPATH**.
- * Your ``./vendor`` directory may not contain ``BUILD`` files.
- Usage:
- 1. Get kazel by running ``go get k8s.io/repo-infra/kazel``.
- 2. Create a ``.kazelcfg.json`` in the root of the repository. For the
- kazel repository, the ``.kazelcfg.json`` would look like:
- .. code-block:: json
- {
- "GoPrefix": "k8s.io/repo-infra",
- "SrcDirs": [
- "./kazel"
- ],
- "SkippedPaths": [
- ".*foobar(baz)?.*$"
- ]
- }
- 3. Run kazel:
- .. code-block:: bash
- $ kazel -root=$GOPATH/src/k8s.io/repo-infra
- Defaults:
- kazel reconciles rules that have the "**automanaged**" tag. If
- you no longer want kazel to manage a rule, you can remove the
- **automanaged** tag and kazel will no longer manage that rule.
- kazel only manages srcs, deps, and library attributes of a
- rule after initial creation so you can add and managed other
- attributes like data and copts and kazel will respect your
- changes.
- kazel automatically formats all ``BUILD`` files in your repository
- except for those matching **SkippedPaths**.
- Adding "sources" rules:
- If you run kazel with ``--validate``, it will not update any ``BUILD`` files, but it
- will exit nonzero if any ``BUILD`` files are out-of-date. You can add ``--print-diff``
- to print out the changes needed.
|