Since procedural macros are always a separate crate, here is the structure of my project:
crate
|-- macros
|--Cargo.toml
Cargo.toml
:
[dependencies].
macros = {path = "macros"}
[workspace]
members = ["macros"]
But here's the problem: To publish the library on crates.io, I need to publish the crates separately, so before publishing I have to change crate cargo.toml
and reference macros
from crates.io:
[dependencies].
macros = "0.1.0"
This makes it much more complicated, as I don't want to publish it after every change to macros
, only for the main crate
to always reference macros
c crates.io.
Is there not a more convenient strategy for this, given that I want macros
to be part of the worspace
of my crate
.
Further, the library is stored in the github repository as follows:
crate
|-- macros
|--Cargo.toml
Before each publication on crates.io, I have to commit the changes as follows:
crate Cargo.toml
always depends on crates.io macros
, specifying a version that has not yet been published (first git commit
then cargo publish
).
And this seems strange, because on github
my crate
is the same as locally. So when cloning my crate
repository (which will include macros
), the user will see in crate Cargo.toml
a link to crates.io macros
, while he will have the local macros
.
How to also change the strategy with respect to git
?