-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from kardeiz/with-syntex-feature
With syntex feature
- Loading branch information
Showing
3 changed files
with
41 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "textnonce" | ||
version = "0.2.4" | ||
version = "0.2.5" | ||
description = "Text based random nonce generator" | ||
authors = [ | ||
"Mike Dilger <[email protected]>", | ||
|
@@ -13,13 +13,18 @@ license = "MIT OR Apache-2.0" | |
keywords = [ "nonce", "random" ] | ||
build = "build.rs" | ||
|
||
[features] | ||
default = ["with-syntex"] | ||
with-syntex = ["syntex", "serde_codegen"] | ||
|
||
[build-dependencies] | ||
serde_codegen = "^0" | ||
syntex = "^0" | ||
serde_codegen = { version = "^0", optional = true } | ||
syntex = { version = "^0", optional = true } | ||
|
||
[dependencies] | ||
rand = "^0.3" | ||
time = "^0.1" | ||
rustc-serialize = "^0.3" | ||
serde = "^0" | ||
clippy = { version = "^0", optional = true } | ||
serde_macros = { version = "^0", optional = true } | ||
clippy = { version = "^0", optional = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
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; | ||
|
||
fn main() { | ||
let out_dir = env::var_os("OUT_DIR").unwrap(); | ||
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 src = Path::new("src/lib.rs.in"); | ||
let dst = Path::new(&out_dir).join("lib.rs"); | ||
let mut registry = syntex::Registry::new(); | ||
|
||
let mut registry = syntex::Registry::new(); | ||
serde_codegen::register(&mut registry); | ||
registry.expand("", &src, &dst).unwrap(); | ||
} | ||
} | ||
|
||
serde_codegen::register(&mut registry); | ||
registry.expand("", &src, &dst).unwrap(); | ||
#[cfg(not(feature = "with-syntex"))] | ||
mod inner { | ||
pub fn main() {} | ||
} | ||
|
||
fn main() { | ||
inner::main(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters