Skip to content

Commit

Permalink
Initialize the macro project.
Browse files Browse the repository at this point in the history
  • Loading branch information
gudaoxuri committed Aug 10, 2022
1 parent f6d805d commit db63d90
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[workspace]
# members = [".", "tardis-macros", "examples/*"]
members = [".", "examples/*"]
members = [".", "tardis-macros", "examples/*"]

[package]
name = "tardis"
Expand Down Expand Up @@ -30,8 +29,7 @@ name = "tardis"
path = "src/lib.rs"

[features]
#default = ["trace", "rt_tokio", "tardis-macros"]
default = ["trace", "rt_tokio"]
default = ["trace", "rt_tokio", "tardis-macros"]
trace = ["tracing", "tracing-subscriber"]
crypto = ["rust-crypto", "rsa"]
crypto_with_sm = ["libsm", "num-bigint"]
Expand Down Expand Up @@ -66,7 +64,7 @@ url = { version = "2.2" }
openssl = { version = "0.10", features = ["vendored"] }

# macros
# tardis-macros = { path = "tardis-macros", optional = true }
tardis-macros = { path = "tardis-macros", optional = true }

# Tokio
tokio = { version = "1.18", features = ["macros", "rt-multi-thread", "signal", "time"], optional = true }
Expand All @@ -89,7 +87,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"], optional = tr

# RelDB
sea-orm = { version = "0.9", features = ["sqlx-all", "macros", "runtime-tokio-native-tls", "debug-print"], optional = true }
sqlparser = { version = "0.18", optional = true }
sqlparser = { version = "0.19", optional = true }

# Web Server
poem-openapi = { version = "2", features = ["rapidoc", "chrono"], optional = true }
Expand All @@ -111,7 +109,7 @@ async-global-executor = { version = "2.0", optional = true }
lettre = { version = "0.10.0-rc.6", features = ["smtp-transport", "tokio1", "tokio1-native-tls", "builder"], optional = true }

#Object Storage
rust-s3 = { version = "0.31", optional = true }
rust-s3 = { version = "0.32", optional = true }
anyhow = { version = "1.0", optional = true }

# Test
Expand Down
32 changes: 32 additions & 0 deletions tardis-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "tardis-macros"
version = "0.1.0-alpha18"
authors = ["gudaoxuri <i@sunisle.org>"]
description = "Elegant, clean Rust development framework"
keywords = ["http", "database", "web", "redis", "mq"]
categories = [
"asynchronous",
"web-programming",
"database",
"caching",
]
homepage = "https://github.com/ideal-world/tardis"
documentation = "https://docs.rs/tardis/"
repository = "https://github.com/ideal-world/tardis"
license = "MIT"
edition = "2021"
readme = "README.md"

[lib]
name = "tardis_macros"
path = "src/lib.rs"
proc_macro = true

[dependencies]
syn = { version = "1", features = ["full", "extra-traits"] }
quote = "1"
proc-macro2 = "1"

[dev-dependencies]


5 changes: 5 additions & 0 deletions tardis-macros/examples/struct_copy_example.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use tardis_macros::sql;

fn main() {
// TODO
}
8 changes: 8 additions & 0 deletions tardis-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn struct_copy(args: TokenStream, input: TokenStream) -> TokenStream {
let _ = args;
let _ = input;
unimplemented!()
}

0 comments on commit db63d90

Please sign in to comment.