From fbfcd48483c74f25a6fd48b591859903f3e408cb Mon Sep 17 00:00:00 2001 From: NikVolf Date: Mon, 1 Aug 2016 19:55:38 +0200 Subject: [PATCH] drying sync --- Cargo.lock | 1 - sync/Cargo.toml | 1 - sync/build.rs | 22 ++-------------------- sync/src/lib.rs | 2 +- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fda431f5..94aabf26b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -519,7 +519,6 @@ dependencies = [ "parking_lot 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (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)", ] diff --git a/sync/Cargo.toml b/sync/Cargo.toml index 3077ee78b..71ae2a686 100644 --- a/sync/Cargo.toml +++ b/sync/Cargo.toml @@ -9,7 +9,6 @@ build = "build.rs" [lib] [build-dependencies] -syntex = "0.33" ethcore-ipc-codegen = { path = "../ipc/codegen" } [dependencies] diff --git a/sync/build.rs b/sync/build.rs index e0c418ea1..cdb717e0e 100644 --- a/sync/build.rs +++ b/sync/build.rs @@ -14,26 +14,8 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -extern crate syntex; -extern crate ethcore_ipc_codegen as codegen; - -use std::env; -use std::path::Path; +extern crate ethcore_ipc_codegen; fn main() { - let out_dir = env::var_os("OUT_DIR").unwrap(); - - // sync interface - { - let src = Path::new("src/api.rs"); - let intermediate = Path::new(&out_dir).join("api.intermediate.rs"); - let mut registry = syntex::Registry::new(); - codegen::register(&mut registry); - registry.expand("", &src, &intermediate).unwrap(); - - let dst = Path::new(&out_dir).join("api.ipc.rs"); - let mut registry = syntex::Registry::new(); - codegen::register(&mut registry); - registry.expand("", &intermediate, &dst).unwrap(); - } + ethcore_ipc_codegen::derive_ipc("src/api.rs").unwrap(); } diff --git a/sync/src/lib.rs b/sync/src/lib.rs index 29a07393c..f6884235b 100644 --- a/sync/src/lib.rs +++ b/sync/src/lib.rs @@ -84,7 +84,7 @@ mod tests; mod api { #![allow(dead_code, unused_assignments, unused_variables, missing_docs)] // codegen issues - include!(concat!(env!("OUT_DIR"), "/api.ipc.rs")); + include!(concat!(env!("OUT_DIR"), "/api.rs")); } pub use api::{EthSync, SyncProvider, SyncClient, NetworkManagerClient, ManageNetwork, SyncConfig,