Skip to content
Snippets Groups Projects
Unverified Commit 7a234923 authored by bgallois's avatar bgallois
Browse files

move runtime api doc to target artefact

parent 09df9b03
No related branches found
No related tags found
No related merge requests found
Pipeline #36481 failed
This commit is part of merge request !254. Comments created here will be created in the context of that merge request.
This diff is collapsed.
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
- [docs](./docs/) - [docs](./docs/)
- [api](./docs/api/) - [api](./docs/api/)
- [manual](./docs/api/manual.md) - [manual](./docs/api/manual.md)
- [runtime-calls](./docs/api/runtime-calls.md) the calls you can submit through the RPC API
- [dev](./docs/dev/) - [dev](./docs/dev/)
- [beginner-walkthrough](./docs/dev/beginner-walkthrough.md) - [beginner-walkthrough](./docs/dev/beginner-walkthrough.md)
- [git-conventions](./docs/dev/git-conventions.md) - [git-conventions](./docs/dev/git-conventions.md)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -43,9 +43,9 @@ where ...@@ -43,9 +43,9 @@ where
// consts // consts
const CALLS_DOC_FILEPATH: &str = "docs/api/runtime-calls.md"; const CALLS_DOC_FILEPATH: &str = "target/doc/runtime-calls.md";
const EVENTS_DOC_FILEPATH: &str = "docs/api/runtime-events.md"; const EVENTS_DOC_FILEPATH: &str = "target/doc/runtime-events.md";
const ERRORS_DOC_FILEPATH: &str = "docs/api/runtime-errors.md"; const ERRORS_DOC_FILEPATH: &str = "target/doc/runtime-errors.md";
const TEMPLATES_GLOB: &str = "xtask/res/templates/*.md"; const TEMPLATES_GLOB: &str = "xtask/res/templates/*.md";
const WEIGHT_FILEPATH: &str = "runtime/common/src/weights/"; const WEIGHT_FILEPATH: &str = "runtime/common/src/weights/";
...@@ -311,6 +311,18 @@ pub(super) fn gen_doc() -> Result<()> { ...@@ -311,6 +311,18 @@ pub(super) fn gen_doc() -> Result<()> {
let (call_doc, event_doc, error_doc) = print_runtime(runtime); let (call_doc, event_doc, error_doc) = print_runtime(runtime);
// Generate docs from rust code
Command::new("cargo")
.args([
"doc",
"--workspace",
"--no-deps",
"--document-private-items",
"--features=runtime-benchmarks",
])
.status()
.expect("cargo doc failed to execute");
let mut file = File::create(CALLS_DOC_FILEPATH) let mut file = File::create(CALLS_DOC_FILEPATH)
.with_context(|| format!("Failed to create file '{}'", CALLS_DOC_FILEPATH))?; .with_context(|| format!("Failed to create file '{}'", CALLS_DOC_FILEPATH))?;
file.write_all(call_doc.as_bytes()) file.write_all(call_doc.as_bytes())
...@@ -324,23 +336,6 @@ pub(super) fn gen_doc() -> Result<()> { ...@@ -324,23 +336,6 @@ pub(super) fn gen_doc() -> Result<()> {
file.write_all(error_doc.as_bytes()) file.write_all(error_doc.as_bytes())
.with_context(|| format!("Failed to write to file '{}'", ERRORS_DOC_FILEPATH))?; .with_context(|| format!("Failed to write to file '{}'", ERRORS_DOC_FILEPATH))?;
// Generate docs from rust code
Command::new("cargo")
.args([
"doc",
"--workspace",
"--document-private-items",
"--features=runtime-benchmarks",
])
.status()
.expect("cargo doc failed to execute");
// Organise folder for deployment
Command::new("cp")
.args(["-r", "./target/doc", "./docs/api/"])
.status()
.expect("failed to build docs folder");
Ok(()) Ok(())
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment