Skip to content
Snippets Groups Projects
Commit 52a0910c authored by Michal Kucharczyk's avatar Michal Kucharczyk Committed by GitHub
Browse files

`construct_runtime`: support for expanding the macro code (#14379)


* construct_runtime: support for expanding the macro code

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: default avatarBastian Köcher <git@kchr.de>

* Update frame/support/procedural/Cargo.toml

Co-authored-by: default avatarBastian Köcher <git@kchr.de>

* fmt added

* fmt removed

---------

Co-authored-by: default avatarBastian Köcher <git@kchr.de>
parent e9bb5e73
Branches
No related merge requests found
......@@ -2848,6 +2848,7 @@ dependencies = [
"Inflector",
"cfg-expr",
"derive-syn-parse",
"expander",
"frame-support-procedural-tools",
"itertools",
"macro_magic",
......
......@@ -25,6 +25,7 @@ syn = { version = "2.0.16", features = ["full"] }
frame-support-procedural-tools = { version = "4.0.0-dev", path = "./tools" }
proc-macro-warning = { version = "0.4.1", default-features = false }
macro_magic = { version = "0.3.5", features = ["proc_support"] }
expander = "2.0.0"
[features]
default = ["std"]
......
......@@ -178,7 +178,15 @@ pub fn construct_runtime(input: TokenStream) -> TokenStream {
.and_then(|_| construct_runtime_final_expansion(explicit_decl)),
};
res.unwrap_or_else(|e| e.to_compile_error()).into()
let res = res.unwrap_or_else(|e| e.to_compile_error());
let res = expander::Expander::new("construct_runtime")
.dry(std::env::var("FRAME_EXPAND").is_err())
.verbose(true)
.write_to_out_dir(res)
.expect("Does not fail because of IO in OUT_DIR; qed");
res.into()
}
/// When some pallet have implicit parts definition then the macro will expand into a macro call to
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment