From 8d7a49891f8e6db1c528ce4b212029612c077472 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 20 May 2016 14:14:29 +0200 Subject: [PATCH] chore(dependencies): update to latest version + nightly support Nightly is now supported, in theory, to allow not to use serde_codegen, which currently has trouble to build thanks to an assertion error. Nightly on the other hand suffers from being build with incorrect feature-flags, which makes quasi_macros fail to build ... . --- etc/api/type-cli.yaml | 6 +++--- src/mako/Cargo.toml.mako | 19 ++++++++++++------- src/mako/api/build.rs.mako | 38 +++++++++++++++++++++++++------------- src/mako/api/lib.rs.mako | 6 ++++++ 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/etc/api/type-cli.yaml b/etc/api/type-cli.yaml index 3082b72440..04d3288b08 100644 --- a/etc/api/type-cli.yaml +++ b/etc/api/type-cli.yaml @@ -26,6 +26,6 @@ cargo: keywords: [cli] is_executable: YES dependencies: - - strsim = "0.4" - - yup-hyper-mock = "1.0" - - clap = "2.0" + - strsim = "^0.4" + - yup-hyper-mock = "^1.0" + - clap = "^2.0" diff --git a/src/mako/Cargo.toml.mako b/src/mako/Cargo.toml.mako index 107354da67..ca9356f620 100644 --- a/src/mako/Cargo.toml.mako +++ b/src/mako/Cargo.toml.mako @@ -26,19 +26,24 @@ name = "${util.program_name()}" % endif [dependencies] -hyper = "0.8" +hyper = "^ 0.9" ## Must match the one hyper uses, otherwise there are duplicate similarly named `Mime` structs -mime = "0.2.0" -serde = "0.6.0" -serde_json = "0.6.0" -yup-oauth2 = ">= 0.5.6" +mime = "^ 0.2.0" +serde = "^ 0.7.5" +serde_json = "^ 0.7.0" +serde_macros = { version = "0.7.5", optional = true } % for dep in cargo.get('dependencies', list()): ${dep} % endfor +[features] +default = ["with_syntex"] +nightly = ["serde_macros"] +with_syntex = ["serde_codegen", "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 } % if make.depends_on_suffix is not None: diff --git a/src/mako/api/build.rs.mako b/src/mako/api/build.rs.mako index 03dd77aa65..2370106974 100644 --- a/src/mako/api/build.rs.mako +++ b/src/mako/api/build.rs.mako @@ -1,17 +1,29 @@ <%namespace name="util" file="../lib/util.mako"/>\ -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("${util.crate_name()}", &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("${util.crate_name()}", &src, &dst).unwrap(); -} + inner::main() +} \ No newline at end of file diff --git a/src/mako/api/lib.rs.mako b/src/mako/api/lib.rs.mako index b3466da3e6..a62cfba078 100644 --- a/src/mako/api/lib.rs.mako +++ b/src/mako/api/lib.rs.mako @@ -17,6 +17,12 @@ ${lib.docs(c)} // 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")); \ No newline at end of file