Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Getting rid of syntex
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Drwięga committed Aug 19, 2016
1 parent 070a215 commit d996754
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 40 deletions.
7 changes: 1 addition & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ build = "build.rs"

[build-dependencies]
rustc_version = "0.1"
syntex = "*"
ethcore-ipc-codegen = { path = "ipc/codegen" }
ethcore-ipc-tests = { path = "ipc/tests" }

Expand Down
1 change: 0 additions & 1 deletion dapps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ clippy = { version = "0.0.82", optional = true}

[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"

[features]
default = ["serde_codegen", "extra-dapps"]
Expand Down
6 changes: 1 addition & 5 deletions dapps/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#[cfg(not(feature = "serde_macros"))]
mod inner {
extern crate syntex;
extern crate serde_codegen;

use std::env;
Expand All @@ -28,10 +27,7 @@ mod inner {
let src = Path::new("./src/api/types.rs.in");
let dst = Path::new(&out_dir).join("types.rs");

let mut registry = syntex::Registry::new();

serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
serde_codegen::expand(&src, &dst).unwrap();
}
}

Expand Down
1 change: 0 additions & 1 deletion db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ authors = ["Ethcore <admin@ethcore.io>"]
build = "build.rs"

[build-dependencies]
syntex = "*"
ethcore-ipc-codegen = { path = "../ipc/codegen" }

[dependencies]
Expand Down
9 changes: 2 additions & 7 deletions db/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

extern crate syntex;
extern crate ethcore_ipc_codegen as codegen;

use std::env;
Expand All @@ -27,17 +26,13 @@ pub fn main() {
{
let src = Path::new("src/lib.rs.in");
let dst = Path::new(&out_dir).join("lib.intermediate.rs.in");
let mut registry = syntex::Registry::new();
codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
codegen::expand(&src, &dst);
}

// binary serialization pass
{
let src = Path::new(&out_dir).join("lib.intermediate.rs.in");
let dst = Path::new(&out_dir).join("lib.rs");
let mut registry = syntex::Registry::new();
codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
codegen::expand(&src, &dst);
}
}
1 change: 0 additions & 1 deletion ethstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ itertools = "0.4"

[build-dependencies]
serde_codegen = { version = "0.7", optional = true }
syntex = "0.33.0"

[features]
default = ["serde_codegen"]
Expand Down
6 changes: 1 addition & 5 deletions ethstore/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#[cfg(not(feature = "serde_macros"))]
mod inner {
extern crate syntex;
extern crate serde_codegen;

use std::env;
Expand All @@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/json/mod.rs.in");
let dst = Path::new(&out_dir).join("mod.rs");

let mut registry = syntex::Registry::new();

serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
serde_codegen::expand(&src, &dst).unwrap();
}
}

Expand Down
7 changes: 7 additions & 0 deletions ipc/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ include!(concat!(env!("OUT_DIR"), "/lib.rs"));
#[cfg(not(feature = "with-syntex"))]
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")]
pub fn register(reg: &mut syntex::Registry) {
use syntax::{ast, fold};
Expand Down
1 change: 0 additions & 1 deletion ipc/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ ethcore-util = { path = "../../util" }
log = "0.3"

[build-dependencies]
syntex = "0.33"
ethcore-ipc-codegen = { path = "../codegen" }
1 change: 0 additions & 1 deletion json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ clippy = { version = "0.0.82", optional = true}

[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"

[features]
default = ["serde_codegen"]
Expand Down
6 changes: 1 addition & 5 deletions json/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#[cfg(not(feature = "serde_macros"))]
mod inner {
extern crate syntex;
extern crate serde_codegen;

use std::env;
Expand All @@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/lib.rs.in");
let dst = Path::new(&out_dir).join("lib.rs");

let mut registry = syntex::Registry::new();

serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
serde_codegen::expand(&src, &dst).unwrap();
}
}

Expand Down
1 change: 0 additions & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ ethcore-ipc = { path = "../ipc/rpc" }

[build-dependencies]
serde_codegen = { version = "0.7.0", optional = true }
syntex = "*"

[features]
default = ["serde_codegen"]
Expand Down
6 changes: 1 addition & 5 deletions rpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#[cfg(not(feature = "serde_macros"))]
mod inner {
extern crate syntex;
extern crate serde_codegen;

use std::env;
Expand All @@ -28,10 +27,7 @@ mod inner {
let src = Path::new("src/v1/types/mod.rs.in");
let dst = Path::new(&out_dir).join("mod.rs");

let mut registry = syntex::Registry::new();

serde_codegen::register(&mut registry);
registry.expand("", &src, &dst).unwrap();
serde_codegen::expand(&src, &dst).unwrap();
}
}

Expand Down

0 comments on commit d996754

Please sign in to comment.