fix(dependencies): use working version of serde-codegen

This update fixes the build on stable, and allows builds
on nightly as usual.

The trick is to use the latest version of serde-codegen,
which keeps the syntex version internal, preventing clashes
between libraries that might have different requirements.
This commit is contained in:
Sebastian Thiel
2016-07-17 12:05:14 +02:00
parent 850e115e33
commit 3921b6a5a0
4 changed files with 11 additions and 16 deletions

View File

@@ -19,5 +19,5 @@ env:
global:
secure: Plj5DqAQX/4+KPM+nOAZ2sCbGIsoSrHo1YggfesQnU7paR734XO/4IayWnsNO/3q6bDi4GIcn56RUZAD3xBJJBNLia2CYIickIIYORRqLWbLdbzQaxBbD670ahtzEuUSFJTRKURPwFteAnsWYgNMNzwXOVNwLS5IUBqWTcS+N0g=
matrix:
- FEATURE=with-syntex
- FEATURE=with-serde-codegen
- FEATURE=nightly

View File

@@ -32,7 +32,7 @@ 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 }
serde_macros = { version = "^ 0.7.5", optional = true }
% for dep in cargo.get('dependencies', list()):
${dep}
% endfor
@@ -43,20 +43,19 @@ ${dep}
crate_name_we_depend_on = None
nightly_features = ["serde_macros", "yup-oauth2/nightly"]
default_features = ["serde_codegen", "syntex", "yup-oauth2/with-syntex"]
default_features = ["serde_codegen", "yup-oauth2/with-serde-codegen"]
if make.depends_on_suffix is not None:
crate_name_we_depend_on = library_to_crate_name(api_name, suffix=make.depends_on_suffix)
nightly_features.append(crate_name_we_depend_on + '/nightly')
default_features.append(crate_name_we_depend_on + '/with-syntex')
default_features.append(crate_name_we_depend_on + '/with-serde-codegen')
%>\
default = ["with-syntex"]
default = ["with-serde-codegen"]
nightly = [${','.join(enclose_in('"', nightly_features))}]
with-syntex = [${','.join(enclose_in('"', default_features))}]
with-serde-codegen = [${','.join(enclose_in('"', default_features))}]
[build-dependencies]
syntex = { version = "= 0.32", optional = true }
serde_codegen = { version = "= 0.7.5", optional = true }
serde_codegen = { version = "^ 0.7.14", optional = true }
% if make.depends_on_suffix is not None:

View File

@@ -1,7 +1,5 @@
<%namespace name="util" file="../lib/util.mako"/>\
#[cfg(feature = "with-syntex")]
#[cfg(feature = "with-serde-codegen")]
mod inner {
extern crate syntex;
extern crate serde_codegen;
use std::env;
@@ -13,13 +11,11 @@ mod inner {
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();
serde_codegen::expand(&src, &dst).unwrap();
}
}
#[cfg(not(feature = "with-syntex"))]
#[cfg(not(feature = "with-serde-codegen"))]
mod inner {
pub fn main() {}
}

View File

@@ -24,5 +24,5 @@ ${lib.docs(c)}
#[cfg(feature = "nightly")]
include!("lib.rs.in");
#[cfg(feature = "with-syntex")]
#[cfg(feature = "with-serde-codegen")]
include!(concat!(env!("OUT_DIR"), "/lib.rs"));