Skip to content

Commit

Permalink
prepare macro crate for publishing to crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Calsign committed Nov 20, 2023
1 parent b764243 commit 00e88bc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
name = "gazelle"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "Helper macros for the gazelle_rust build file generator"
homepage = "https://github.com/Calsign/gazelle_rust/tree/main/macro"
repository = "https://github.com/Calsign/gazelle_rust"
keywords = ["bazel", "gazelle_rust"]
categories = ["development-tools"]
exclude = ["BUILD.bazel", "src/BUILD.bazel", "tests/BUILD.bazel"]

[lib]
name = "gazelle"
Expand Down
18 changes: 15 additions & 3 deletions macro/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
gazelle\_rust is a gazelle language plugin for Rust; automatic dependency management for projects
built with Bazel.

This is a tiny proc_macro crate that provides attribute macros for gazelle. The macros return their
References:
- [gazelle\_rust](https://github.com/Calsign/gazelle_rust)
- [Gazelle](https://github.com/bazelbuild/bazel-gazelle)
- [rules\_rust](https://github.com/bazelbuild/rules_rust)
- [Bazel](https://bazel.build/)

This is a tiny proc\_macro crate that provides attribute macros for gazelle. The macros return their
inputs unchanged, and exist only to pass information to gazelle. The attributes are also referred to
as "directives".

An alternative would be for gazelle to parse special comments. Using the attribute is nicer in some
ways: it allows more direct control over which items should be affected by a particular directive,
and it's easier to integrate into the existing syn-based parser.

This crate has a cargo-compatible directory structure so that in the future it can be published on
crates.io to support projects that build with both bazel and cargo.
This crate has a cargo-compatible directory because it is also published to crates.io to support
projects that build both with bazel and cargo.

Since crates.io has a global namespace, this is the one and only "gazelle" package. Please reach out
to me if you're working on an alternative gazelle plugin for Rust, I'm happy to make changes as long
as backwards-compatibility is maintained.

0 comments on commit 00e88bc

Please sign in to comment.