mirror of
https://github.com/OMGeeky/yup-oauth2.git
synced 2026-02-23 15:50:00 +01:00
fix(lib): setup nightly crate meta data correctly
* Previously the meta-data was applied to the crate, which doesn't seem to work. * attempted to make `examples/auth.rs` work on stable. This isn't properly tested now, as tests don't compile. We are now at a state were stable as well as nightly work similarly, but fail because `include!` doesn't behave correctly if macros are involved. Namely it happens before crates are linked, yet it will try to expand macros right away, which is a problem. If the macro is defined in an empty fashion, it will actually be used at include time, and expanded. Which causes issues further down the compilation. With the current 'fix' we manage to at least make everything but `cargo test` work. Related to #12
This commit is contained in:
@@ -60,7 +60,8 @@
|
||||
//! };
|
||||
//! # }
|
||||
//! ```
|
||||
#![cfg_attr(feature = "nightly", feature(custom_derive))]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_derive, custom_attribute, plugin))]
|
||||
#![cfg_attr(feature = "nightly", plugin(serde_macros))]
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
include!("lib.rs.in");
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
#[cfg_attr(feature = "nightly", feature(plugin))]
|
||||
#[cfg_attr(feature = "nightly", plugin(serde_macros))]
|
||||
/// NOTE: This makes `cargo build` work, but `cargo test` still fails as these
|
||||
/// override the macros that should come from `yup_hyper_mock`
|
||||
#[cfg(not(test))]
|
||||
macro_rules! mock_connector (
|
||||
($name:ident {
|
||||
$($url:expr => $res:expr)*
|
||||
}) => (
|
||||
)
|
||||
);
|
||||
|
||||
#[cfg(not(test))]
|
||||
macro_rules! mock_connector_in_order (
|
||||
($name:ident {
|
||||
$( $res:expr )*
|
||||
}) => (
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
extern crate serde;
|
||||
|
||||
extern crate chrono;
|
||||
|
||||
#[macro_use]
|
||||
extern crate hyper;
|
||||
#[macro_use]
|
||||
#[macro_use] #[cfg(test)]
|
||||
extern crate log;
|
||||
#[macro_use] #[cfg(test)]
|
||||
extern crate yup_hyper_mock;
|
||||
|
||||
Reference in New Issue
Block a user