1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-30 18:44:35 +01:00
actix-web/build.rs

50 lines
1.3 KiB
Rust
Raw Normal View History

2017-10-26 15:12:23 +02:00
extern crate skeptic;
2017-11-24 19:28:43 +01:00
extern crate version_check;
2017-10-26 15:12:23 +02:00
use std::{env, fs};
#[cfg(unix)]
fn main() {
println!("cargo:rerun-if-env-changed=USE_SKEPTIC");
2017-11-28 21:44:59 +01:00
let f = env::var("OUT_DIR").unwrap() + "/skeptic-tests.rs";
2017-10-26 15:12:23 +02:00
if env::var("USE_SKEPTIC").is_ok() {
2017-11-28 21:44:59 +01:00
let _ = fs::remove_file(f);
2017-10-26 15:12:23 +02:00
// generates doc tests for `README.md`.
2017-11-28 21:44:59 +01:00
skeptic::generate_doc_tests(
2018-03-12 17:13:04 +01:00
&[// "README.md",
"guide/src/qs_1.md",
2017-11-28 21:44:59 +01:00
"guide/src/qs_2.md",
"guide/src/qs_3.md",
2017-12-14 06:38:47 +01:00
"guide/src/qs_3_5.md",
"guide/src/qs_4.md",
2017-12-09 00:25:37 +01:00
"guide/src/qs_4_5.md",
"guide/src/qs_5.md",
"guide/src/qs_7.md",
2017-12-27 02:14:37 +01:00
"guide/src/qs_8.md",
"guide/src/qs_9.md",
"guide/src/qs_10.md",
"guide/src/qs_12.md",
"guide/src/qs_13.md",
2018-01-23 05:10:05 +01:00
"guide/src/qs_14.md",
2017-11-28 21:44:59 +01:00
]);
2017-10-26 15:12:23 +02:00
} else {
let _ = fs::File::create(f);
}
2017-11-24 19:28:43 +01:00
match version_check::is_nightly() {
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
Some(false) => (),
None => (),
};
2017-10-26 15:12:23 +02:00
}
#[cfg(not(unix))]
fn main() {
2017-11-24 19:28:43 +01:00
match version_check::is_nightly() {
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
Some(false) => (),
None => (),
};
2017-10-26 15:12:23 +02:00
}