Skip to content

Commit

Permalink
fix(docs): fix snippet publishing (#512)
Browse files Browse the repository at this point in the history
* fix(docs): fix snippet publishing

* fix(docs): explicitly list which files to publish
  • Loading branch information
rohanku authored Jan 22, 2025
1 parent 5bb9121 commit 456f8bf
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"codegen": "0.9.0",
"config": "0.3.0",
"docs/snippets": "0.6.0",
"examples": "0.1.0",
"examples/latest/sky130_inverter": "0.0.0",
"examples/latest/spice_vdivider": "0.0.0",
"examples/latest/colbuf": "0.0.0",
Expand Down
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rust_decimal_macros = "1.30"

[build-dependencies]
snippets = { version = "0.6.0", registry = "substrate", path = "../docs/snippets" }
examples = { version = "0.1.0", registry = "substrate", path = "../examples" }

[lib]
proc-macro = true
5 changes: 1 addition & 4 deletions codegen/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use snippets::build_snippets;

fn main() {
let example_path = concat!(
env!("CARGO_MANIFEST_DIR"),
"/../examples/latest/substrate_api_examples/src/lib.rs"
);
let example_path = examples::get_path("latest/substrate_api_examples/src/lib.rs");
println!("cargo::rerun-if-changed={example_path}");
build_snippets(example_path, "substrate");
}
8 changes: 8 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "examples"
version = "0.1.0"
edition = "2021"
include = [
"**/*.rs",
"Cargo.toml",
]
3 changes: 3 additions & 0 deletions examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn get_path(rel_path: &str) -> String {
format!("{}/{rel_path}", env!("CARGO_MANIFEST_DIR"))
}
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"codegen": {},
"config": {},
"docs/snippets": {},
"examples": {},
"examples/latest/sky130_inverter": {},
"examples/latest/spice_vdivider": {},
"examples/latest/colbuf": {},
Expand Down
1 change: 1 addition & 0 deletions substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ lazy_static = "1"

[build-dependencies]
snippets = { version = "0.6.0", registry = "substrate", path = "../docs/snippets" }
examples = { version = "0.1.0", registry = "substrate", path = "../examples" }
5 changes: 1 addition & 4 deletions substrate/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use snippets::build_snippets;

fn main() {
let example_path = concat!(
env!("CARGO_MANIFEST_DIR"),
"/../examples/latest/substrate_api_examples/src/lib.rs"
);
let example_path = examples::get_path("latest/substrate_api_examples/src/lib.rs");
println!("cargo::rerun-if-changed={example_path}");
build_snippets(example_path, "substrate");
}

0 comments on commit 456f8bf

Please sign in to comment.