2024-05-22 04:47:32 -05:00
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
2024-06-07 07:10:27 -05:00
|
|
|
use run_make_support::{htmldocck, rust_lib_name, rustc, rustdoc};
|
2024-05-22 04:47:32 -05:00
|
|
|
|
|
|
|
fn main() {
|
2024-06-06 14:34:34 -05:00
|
|
|
let out_dir = "rustdoc";
|
|
|
|
let ex_dir = "ex.calls";
|
2024-05-22 04:47:32 -05:00
|
|
|
let proc_crate_name = "foobar_macro";
|
|
|
|
let crate_name = "foobar";
|
|
|
|
|
2024-06-07 08:23:10 -05:00
|
|
|
let dylib_name = rustc()
|
|
|
|
.crate_name(proc_crate_name)
|
|
|
|
.crate_type("dylib")
|
2024-07-17 16:54:06 -05:00
|
|
|
.print("file-names")
|
2024-06-07 08:23:10 -05:00
|
|
|
.arg("-")
|
|
|
|
.run()
|
|
|
|
.stdout_utf8();
|
2024-05-22 04:47:32 -05:00
|
|
|
|
|
|
|
rustc()
|
|
|
|
.input("src/proc.rs")
|
|
|
|
.crate_name(proc_crate_name)
|
|
|
|
.edition("2021")
|
|
|
|
.crate_type("proc-macro")
|
|
|
|
.emit("dep-info,link")
|
|
|
|
.run();
|
|
|
|
rustc()
|
|
|
|
.input("src/lib.rs")
|
|
|
|
.crate_name(crate_name)
|
|
|
|
.edition("2021")
|
|
|
|
.crate_type("lib")
|
|
|
|
.emit("dep-info,link")
|
|
|
|
.run();
|
|
|
|
|
|
|
|
rustdoc()
|
|
|
|
.input("examples/ex.rs")
|
|
|
|
.crate_name("ex")
|
|
|
|
.crate_type("bin")
|
2024-08-15 07:44:48 -05:00
|
|
|
.out_dir(&out_dir)
|
2024-06-07 07:07:02 -05:00
|
|
|
.extern_(crate_name, rust_lib_name(crate_name))
|
2024-06-06 14:34:34 -05:00
|
|
|
.extern_(proc_crate_name, dylib_name.trim())
|
2024-05-22 04:47:32 -05:00
|
|
|
.arg("-Zunstable-options")
|
|
|
|
.arg("--scrape-examples-output-path")
|
|
|
|
.arg(&ex_dir)
|
|
|
|
.arg("--scrape-examples-target-crate")
|
|
|
|
.arg(crate_name)
|
|
|
|
.run();
|
|
|
|
|
|
|
|
rustdoc()
|
|
|
|
.input("src/lib.rs")
|
|
|
|
.crate_name(crate_name)
|
|
|
|
.crate_type("lib")
|
2024-08-15 07:44:48 -05:00
|
|
|
.out_dir(&out_dir)
|
2024-05-22 04:47:32 -05:00
|
|
|
.arg("-Zunstable-options")
|
|
|
|
.arg("--with-examples")
|
|
|
|
.arg(&ex_dir)
|
|
|
|
.run();
|
|
|
|
|
2024-06-09 10:45:57 -05:00
|
|
|
htmldocck().arg(out_dir).arg("src/lib.rs").run();
|
2024-05-22 04:47:32 -05:00
|
|
|
}
|