Make sr-api-macros and srml-support renaming of crates (#1757)

Procedural do not support `$crate` to get access to the crate where the
macro is defined. We use a hack to re-export the crate under a known
name. With rust edition 2018, people started to rename their crates in
`Cargo.toml`, but that breaks the re-export. This commit introduces
`proc-maco-crate` that supports finding the requested crate name, even
if it was renamed.
This commit is contained in:
Bastian Köcher
2019-02-11 13:58:41 +01:00
committed by GitHub
parent 35a4aa638c
commit f9975af020
16 changed files with 135 additions and 35 deletions
+4 -4
View File
@@ -10,11 +10,11 @@ safe-mix = { version = "1.0", default-features = false }
parity-codec-derive = { version = "3.0" }
parity-codec = { version = "3.0", default-features = false }
substrate-primitives = { path = "../../core/primitives", default-features = false }
substrate-client = { path = "../../core/client", default-features = false }
client = { package = "substrate-client", path = "../../core/client", default-features = false }
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
version = { package = "sr-version", path = "../../core/sr-version", default-features = false }
srml-support = { path = "../../srml/support", default-features = false }
support = { package = "srml-support", path = "../../srml/support", default-features = false }
aura = { package = "srml-aura", path = "../../srml/aura", default-features = false }
balances = { package = "srml-balances", path = "../../srml/balances", default-features = false }
consensus = { package = "srml-consensus", path = "../../srml/consensus", default-features = false }
@@ -45,7 +45,7 @@ std = [
"substrate-primitives/std",
"rstd/std",
"runtime_primitives/std",
"srml-support/std",
"support/std",
"balances/std",
"consensus/std",
"contract/std",
@@ -65,7 +65,7 @@ std = [
"node-primitives/std",
"serde/std",
"safe-mix/std",
"substrate-client/std",
"client/std",
"consensus_aura/std",
"rustc-hex",
"hex-literal",