mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-25 04:35:18 +01:00
@@ -16,14 +16,20 @@ build = "src/build.rs"
|
||||
|
||||
|
||||
[dependencies]
|
||||
hyper = "0.8"
|
||||
mime = "0.2.0"
|
||||
serde = "0.6.0"
|
||||
serde_json = "0.6.0"
|
||||
yup-oauth2 = ">= 0.5.6"
|
||||
url = ">= 0.5"
|
||||
hyper = "^ 0.9"
|
||||
mime = "^ 0.2.0"
|
||||
serde = "^ 0.7.5"
|
||||
serde_json = "^ 0.7.0"
|
||||
yup-oauth2 = { version = "^ 0.6.0", optional = true, default-features = false }
|
||||
serde_macros = { version = "0.7.5", optional = true }
|
||||
url = "= 0.5"
|
||||
|
||||
[features]
|
||||
default = ["with-syntex"]
|
||||
nightly = ["serde_macros","yup-oauth2/nightly"]
|
||||
with-syntex = ["serde_codegen","syntex","yup-oauth2/with-syntex"]
|
||||
|
||||
[build-dependencies]
|
||||
syntex = { version = "= 0.28" }
|
||||
serde_codegen = { version = "= 0.6.13" }
|
||||
syntex = { version = "= 0.32", optional = true }
|
||||
serde_codegen = { version = "= 0.7.5", optional = true }
|
||||
|
||||
|
||||
@@ -1,16 +1,28 @@
|
||||
extern crate syntex;
|
||||
extern crate serde_codegen;
|
||||
#[cfg(feature = "with-syntex")]
|
||||
mod inner {
|
||||
extern crate syntex;
|
||||
extern crate serde_codegen;
|
||||
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
use std::env;
|
||||
use std::path::Path;
|
||||
|
||||
pub fn main() {
|
||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||
|
||||
let src = Path::new("src/lib.rs.in");
|
||||
let dst = Path::new(&out_dir).join("lib.rs");
|
||||
|
||||
let mut registry = syntex::Registry::new();
|
||||
serde_codegen::register(&mut registry);
|
||||
registry.expand("google-taskqueue1_beta2", &src, &dst).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "with-syntex"))]
|
||||
mod inner {
|
||||
pub fn main() {}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||
|
||||
let src = Path::new("src/lib.rs.in");
|
||||
let dst = Path::new(&out_dir).join("lib.rs");
|
||||
|
||||
let mut registry = syntex::Registry::new();
|
||||
serde_codegen::register(&mut registry);
|
||||
registry.expand("google-taskqueue1_beta2", &src, &dst).unwrap();
|
||||
}
|
||||
inner::main()
|
||||
}
|
||||
@@ -182,6 +182,12 @@
|
||||
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
|
||||
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
|
||||
// unused imports in fully featured APIs. Same with unused_mut ... .
|
||||
#![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]
|
||||
#![cfg_attr(feature = "nightly", plugin(serde_macros))]
|
||||
#![allow(unused_imports, unused_mut, dead_code)]
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
include!("lib.rs.in");
|
||||
|
||||
#[cfg(feature = "with-syntex")]
|
||||
include!(concat!(env!("OUT_DIR"), "/lib.rs"));
|
||||
Reference in New Issue
Block a user