-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Rust Stable (v1.8) via serde codegen
- Loading branch information
Arnau Siches
committed
Apr 24, 2016
1 parent
29d3370
commit 367c26a
Showing
6 changed files
with
179 additions
and
105 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,11 +2,19 @@ | |
name = "tflgtfs" | ||
version = "0.1.0" | ||
authors = ["Tom Burdick <[email protected]>"] | ||
build = "build.rs" | ||
|
||
[features] | ||
default = ["serde_codegen"] | ||
nightly = ["serde_macros"] | ||
|
||
[build-dependencies] | ||
serde_codegen = { version = "0.7", optional = true } | ||
syntex = "*" | ||
|
||
[dependencies] | ||
ansi_term = "0.7" | ||
clap = "2.2" | ||
clippy = "*" | ||
csv = "0.14" | ||
env_logger = "0.3" | ||
hyper = "0.8" | ||
|
@@ -16,4 +24,4 @@ rust-crypto = "0.2" | |
scoped_threadpool = "0.1" | ||
serde = "0.7" | ||
serde_json = "0.7" | ||
serde_macros = "0.7" | ||
serde_macros = { version = "0.7", 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#[cfg(not(feature = "serde_macros"))] | ||
mod inner { | ||
extern crate syntex; | ||
extern crate serde_codegen; | ||
|
||
use std::env; | ||
use std::path::Path; | ||
|
||
pub fn main() { | ||
let out_dir = env::var_os("OUT_DIR").unwrap(); | ||
|
||
let src = Path::new("src/main.rs.in"); | ||
let dst = Path::new(&out_dir).join("main.rs"); | ||
|
||
let mut registry = syntex::Registry::new(); | ||
|
||
serde_codegen::register(&mut registry); | ||
registry.expand("", &src, &dst).unwrap(); | ||
} | ||
} | ||
|
||
#[cfg(feature = "serde_macros")] | ||
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
Oops, something went wrong.