2017-10-26 13:12:23 +00:00
|
|
|
extern crate skeptic;
|
2017-11-24 18:28:43 +00:00
|
|
|
extern crate version_check;
|
|
|
|
|
2017-10-26 13:12:23 +00:00
|
|
|
use std::{env, fs};
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(unix)]
|
|
|
|
fn main() {
|
|
|
|
if env::var("USE_SKEPTIC").is_ok() {
|
|
|
|
// generates doc tests for `README.md`.
|
2017-11-28 00:41:37 +00:00
|
|
|
skeptic::generate_doc_tests(&["README.md", "guide/src/qs_2.md"]);
|
2017-10-26 13:12:23 +00:00
|
|
|
} else {
|
|
|
|
let f = env::var("OUT_DIR").unwrap() + "/skeptic-tests.rs";
|
|
|
|
let _ = fs::File::create(f);
|
|
|
|
}
|
2017-11-24 18:28:43 +00:00
|
|
|
|
|
|
|
match version_check::is_nightly() {
|
|
|
|
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
|
|
|
|
Some(false) => (),
|
|
|
|
None => (),
|
|
|
|
};
|
2017-10-26 13:12:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(unix))]
|
|
|
|
fn main() {
|
2017-11-24 18:28:43 +00:00
|
|
|
match version_check::is_nightly() {
|
|
|
|
Some(true) => println!("cargo:rustc-cfg=actix_nightly"),
|
|
|
|
Some(false) => (),
|
|
|
|
None => (),
|
|
|
|
};
|
2017-10-26 13:12:23 +00:00
|
|
|
}
|