Merge pull request #1965 from ethcore/removing-syntex

Getting rid of syntex
This commit is contained in:
Nikolay Volf 2016-08-19 20:17:50 +04:00 committed by GitHub
commit fcfacc76d5
14 changed files with 14 additions and 40 deletions

7
Cargo.lock generated
View File

@ -36,7 +36,6 @@ dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -292,7 +291,6 @@ dependencies = [
"serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"zip 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "zip 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
@ -370,7 +368,6 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)", "nanomsg 0.5.1 (git+https://github.com/ethcore/nanomsg.rs.git)",
"semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -429,7 +426,6 @@ dependencies = [
"serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"transient-hashmap 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "transient-hashmap 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -504,7 +500,6 @@ dependencies = [
"serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -533,7 +528,6 @@ dependencies = [
"serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_codegen 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"syntex 0.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1702,6 +1696,7 @@ dependencies = [
"checksum isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7408a548dc0e406b7912d9f84c261cc533c1866e047644a811c133c56041ac0c" "checksum isatty 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7408a548dc0e406b7912d9f84c261cc533c1866e047644a811c133c56041ac0c"
"checksum itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "086e1fa5fe48840b1cfdef3a20c7e3115599f8d5c4c87ef32a794a7cdd184d76" "checksum itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "086e1fa5fe48840b1cfdef3a20c7e3115599f8d5c4c87ef32a794a7cdd184d76"
"checksum json-ipc-server 0.2.4 (git+https://github.com/ethcore/json-ipc-server.git)" = "<none>" "checksum json-ipc-server 0.2.4 (git+https://github.com/ethcore/json-ipc-server.git)" = "<none>"
"checksum json-tcp-server 0.1.0 (git+https://github.com/ethcore/json-tcp-server)" = "<none>"
"checksum jsonrpc-core 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec4477e4e8218da23caa5dd31f4eb39999aa0ea9035660617eccfb19a23bf5ad" "checksum jsonrpc-core 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec4477e4e8218da23caa5dd31f4eb39999aa0ea9035660617eccfb19a23bf5ad"
"checksum jsonrpc-http-server 6.1.0 (git+https://github.com/ethcore/jsonrpc-http-server.git)" = "<none>" "checksum jsonrpc-http-server 6.1.0 (git+https://github.com/ethcore/jsonrpc-http-server.git)" = "<none>"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"

View File

@ -8,7 +8,6 @@ build = "build.rs"
[build-dependencies] [build-dependencies]
rustc_version = "0.1" rustc_version = "0.1"
syntex = "*"
ethcore-ipc-codegen = { path = "ipc/codegen" } ethcore-ipc-codegen = { path = "ipc/codegen" }
ethcore-ipc-tests = { path = "ipc/tests" } ethcore-ipc-tests = { path = "ipc/tests" }

View File

@ -33,7 +33,6 @@ clippy = { version = "0.0.82", optional = true}
[build-dependencies] [build-dependencies]
serde_codegen = { version = "0.7.0", optional = true } serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"
[features] [features]
default = ["serde_codegen", "extra-dapps"] default = ["serde_codegen", "extra-dapps"]

View File

@ -16,7 +16,6 @@
#[cfg(not(feature = "serde_macros"))] #[cfg(not(feature = "serde_macros"))]
mod inner { mod inner {
extern crate syntex;
extern crate serde_codegen; extern crate serde_codegen;
use std::env; use std::env;
@ -28,10 +27,7 @@ mod inner {
let src = Path::new("./src/api/types.rs.in"); let src = Path::new("./src/api/types.rs.in");
let dst = Path::new(&out_dir).join("types.rs"); let dst = Path::new(&out_dir).join("types.rs");
let mut registry = syntex::Registry::new(); serde_codegen::expand(&src, &dst).unwrap();
serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
} }

View File

@ -8,7 +8,6 @@ authors = ["Ethcore <admin@ethcore.io>"]
build = "build.rs" build = "build.rs"
[build-dependencies] [build-dependencies]
syntex = "*"
ethcore-ipc-codegen = { path = "../ipc/codegen" } ethcore-ipc-codegen = { path = "../ipc/codegen" }
[dependencies] [dependencies]

View File

@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>. // along with Parity. If not, see <http://www.gnu.org/licenses/>.
extern crate syntex;
extern crate ethcore_ipc_codegen as codegen; extern crate ethcore_ipc_codegen as codegen;
use std::env; use std::env;
@ -27,17 +26,13 @@ pub fn main() {
{ {
let src = Path::new("src/lib.rs.in"); let src = Path::new("src/lib.rs.in");
let dst = Path::new(&out_dir).join("lib.intermediate.rs.in"); let dst = Path::new(&out_dir).join("lib.intermediate.rs.in");
let mut registry = syntex::Registry::new(); codegen::expand(&src, &dst);
codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
// binary serialization pass // binary serialization pass
{ {
let src = Path::new(&out_dir).join("lib.intermediate.rs.in"); let src = Path::new(&out_dir).join("lib.intermediate.rs.in");
let dst = Path::new(&out_dir).join("lib.rs"); let dst = Path::new(&out_dir).join("lib.rs");
let mut registry = syntex::Registry::new(); codegen::expand(&src, &dst);
codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
} }

View File

@ -21,7 +21,6 @@ itertools = "0.4"
[build-dependencies] [build-dependencies]
serde_codegen = { version = "0.7", optional = true } serde_codegen = { version = "0.7", optional = true }
syntex = "0.33.0"
[features] [features]
default = ["serde_codegen"] default = ["serde_codegen"]

View File

@ -16,7 +16,6 @@
#[cfg(not(feature = "serde_macros"))] #[cfg(not(feature = "serde_macros"))]
mod inner { mod inner {
extern crate syntex;
extern crate serde_codegen; extern crate serde_codegen;
use std::env; use std::env;
@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/json/mod.rs.in"); let src = Path::new("src/json/mod.rs.in");
let dst = Path::new(&out_dir).join("mod.rs"); let dst = Path::new(&out_dir).join("mod.rs");
let mut registry = syntex::Registry::new(); serde_codegen::expand(&src, &dst).unwrap();
serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
} }

View File

@ -48,6 +48,13 @@ include!(concat!(env!("OUT_DIR"), "/lib.rs"));
#[cfg(not(feature = "with-syntex"))] #[cfg(not(feature = "with-syntex"))]
include!("lib.rs.in"); include!("lib.rs.in");
#[cfg(feature = "with-syntex")]
pub fn expand(src: &std::path::Path, dst: &std::path::Path) {
let mut registry = syntex::Registry::new();
register(&mut registry);
registry.expand("", src, dst).unwrap();
}
#[cfg(feature = "with-syntex")] #[cfg(feature = "with-syntex")]
pub fn register(reg: &mut syntex::Registry) { pub fn register(reg: &mut syntex::Registry) {
use syntax::{ast, fold}; use syntax::{ast, fold};

View File

@ -17,5 +17,4 @@ ethcore-util = { path = "../../util" }
log = "0.3" log = "0.3"
[build-dependencies] [build-dependencies]
syntex = "0.33"
ethcore-ipc-codegen = { path = "../codegen" } ethcore-ipc-codegen = { path = "../codegen" }

View File

@ -14,7 +14,6 @@ clippy = { version = "0.0.82", optional = true}
[build-dependencies] [build-dependencies]
serde_codegen = { version = "0.7.0", optional = true } serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"
[features] [features]
default = ["serde_codegen"] default = ["serde_codegen"]

View File

@ -16,7 +16,6 @@
#[cfg(not(feature = "serde_macros"))] #[cfg(not(feature = "serde_macros"))]
mod inner { mod inner {
extern crate syntex;
extern crate serde_codegen; extern crate serde_codegen;
use std::env; use std::env;
@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/lib.rs.in"); let src = Path::new("src/lib.rs.in");
let dst = Path::new(&out_dir).join("lib.rs"); let dst = Path::new(&out_dir).join("lib.rs");
let mut registry = syntex::Registry::new(); serde_codegen::expand(&src, &dst).unwrap();
serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
} }

View File

@ -31,7 +31,6 @@ ethcore-ipc = { path = "../ipc/rpc" }
[build-dependencies] [build-dependencies]
serde_codegen = { version = "0.7.0", optional = true } serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"
[features] [features]
default = ["serde_codegen"] default = ["serde_codegen"]

View File

@ -16,7 +16,6 @@
#[cfg(not(feature = "serde_macros"))] #[cfg(not(feature = "serde_macros"))]
mod inner { mod inner {
extern crate syntex;
extern crate serde_codegen; extern crate serde_codegen;
use std::env; use std::env;
@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/v1/types/mod.rs.in"); let src = Path::new("src/v1/types/mod.rs.in");
let dst = Path::new(&out_dir).join("mod.rs"); let dst = Path::new(&out_dir).join("mod.rs");
let mut registry = syntex::Registry::new(); serde_codegen::expand(&src, &dst).unwrap();
serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
} }
} }