Skip to content

Commit

Permalink
Move the core into a workspace and add the derive proc-macro crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Árpád Goretity committed Dec 25, 2018
1 parent a4fac1d commit 3face16
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 31 deletions.
33 changes: 2 additions & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,2 @@
[package]
name = "avocado"
version = "0.0.5" # remember to update version in lib.rs too!
edition = "2018"
authors = ["Árpád Goretity <[email protected]>"]
repository = "https://github.com/H2CO3/avocado.git"
homepage = "https://h2co3.github.io/avocado/"
license = "MIT"
readme = "README.md"
documentation = "https://docs.rs/avocado"
description = "Avocado, the strongly-typed MongoDB driver"
keywords = ["database", "mongodb", "json", "nosql", "driver"]
categories = ["database", "database-implementations", "development-tools", "api-bindings", "web-programming"]

[dependencies]
mongodb = "0.3.12"
bson = { version = "0.13.0", features = ["u2i"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = { version = "1.0", features = ["preserve_order"] }
backtrace = "0.3.13"
bitflags = "1.0.4"
magnet_schema = { version = "0.5.0", optional = true }

[dev-dependencies]
magnet_derive = "0.5.0"
lazy_static = "1.2.0"
scopeguard = "1.0.0"

[features]
schema_validation = ["magnet_schema"]
[workspace]
members = ["avocado", "avocado_derive"]
5 changes: 5 additions & 0 deletions avocado/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TODO.md
/target/
**/*.rs.bk
**/*.swp
Cargo.lock
31 changes: 31 additions & 0 deletions avocado/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[package]
name = "avocado"
version = "0.0.5" # remember to update version in lib.rs too!
edition = "2018"
authors = ["Árpád Goretity <[email protected]>"]
repository = "https://github.com/H2CO3/avocado.git"
homepage = "https://h2co3.github.io/avocado/"
license = "MIT"
readme = "../README.md"
documentation = "https://docs.rs/avocado"
description = "Avocado, the strongly-typed MongoDB driver"
keywords = ["database", "mongodb", "json", "nosql", "driver"]
categories = ["database", "database-implementations", "development-tools", "api-bindings", "web-programming"]

[dependencies]
mongodb = "0.3.12"
bson = { version = "0.13.0", features = ["u2i"] }
serde = "1.0"
serde_derive = "1.0"
serde_json = { version = "1.0", features = ["preserve_order"] }
backtrace = "0.3.13"
bitflags = "1.0.4"
magnet_schema = { version = "0.5.0", optional = true }

[dev-dependencies]
magnet_derive = "0.5.0"
lazy_static = "1.2.0"
scopeguard = "1.0.0"

[features]
schema_validation = ["magnet_schema"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions avocado_derive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TODO.md
/target/
**/*.rs.bk
**/*.swp
Cargo.lock
21 changes: 21 additions & 0 deletions avocado_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "avocado_derive"
version = "0.0.5" # remember to update version in lib.rs too!
edition = "2018"
authors = ["Árpád Goretity <[email protected]>"]
repository = "https://github.com/H2CO3/avocado.git"
homepage = "https://h2co3.github.io/avocado/"
license = "MIT"
readme = "../README.md"
documentation = "https://docs.rs/avocado_derive"
description = "Avocado, the strongly-typed MongoDB driver"
keywords = ["database", "mongodb", "json", "nosql", "driver"]
categories = ["database", "database-implementations", "development-tools", "api-bindings", "web-programming"]

[lib]
proc-macro = true

[dependencies]
proc-macro2 = "0.4.24"
syn = "0.14.9"
quote = "0.6.10"
34 changes: 34 additions & 0 deletions avocado_derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//! This crate only contains the `#[derive(Doc)]` proc-macro for Avocado.
//! For documentation, please see the main [`avocado`][1] crate.
//!
//! [1]: https://docs.rs/avocado
#![crate_type = "proc-macro"]
#![doc(html_root_url = "https://docs.rs/avocado_derive/0.5.0")]
#![deny(missing_debug_implementations, missing_copy_implementations,
trivial_casts, trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces, unused_qualifications,
/* missing_docs (https://github.com/rust-lang/rust/issues/42008) */)]
#![allow(clippy::single_match, clippy::match_same_arms, clippy::match_ref_pats,
clippy::clone_on_ref_ptr, clippy::needless_pass_by_value)]
#![deny(clippy::wrong_pub_self_convention, clippy::used_underscore_binding,
clippy::stutter, clippy::similar_names, clippy::pub_enum_variant_names,
clippy::missing_docs_in_private_items,
clippy::non_ascii_literal, clippy::unicode_not_nfc,
clippy::result_unwrap_used, clippy::option_unwrap_used,
clippy::option_map_unwrap_or_else, clippy::option_map_unwrap_or, clippy::filter_map,
clippy::shadow_unrelated, clippy::shadow_reuse, clippy::shadow_same,
clippy::int_plus_one, clippy::string_add_assign, clippy::if_not_else,
clippy::invalid_upcast_comparisons,
clippy::cast_precision_loss,
clippy::cast_possible_wrap, clippy::cast_possible_truncation,
clippy::mutex_integer, clippy::mut_mut, clippy::items_after_statements,
clippy::print_stdout, clippy::mem_forget, clippy::maybe_infinite_iter)]

#[macro_use]
extern crate quote;
extern crate syn;
extern crate proc_macro;
extern crate proc_macro2;

0 comments on commit 3face16

Please sign in to comment.