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: Bastian Köcher <git@kchr.de>

* Update frame/support/procedural/Cargo.toml

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

* fmt added

* fmt removed

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Michal Kucharczyk
2023-06-14 20:49:48 +02:00
committed by GitHub
parent e9bb5e737a
commit 52a0910c71
3 changed files with 11 additions and 1 deletions
@@ -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