Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump diplomat to 0.9.0 #735

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

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

23 changes: 21 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[workspace]
# Applies to diplomat-core, diplomat, and diplomat-runtime
# Diplomat-tool has no MSRV for now
resolver = "2"
members = [
"core",
Expand All @@ -12,4 +10,25 @@ members = [
]

[workspace.package]

# Individual subcrates may choose to temporarily switch to a different version
version = "0.9.0"
# Applies to diplomat-core, diplomat, and diplomat-runtime
# Diplomat-tool has no MSRV for now
rust-version = "1.71"
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2021"
repository = "https://github.com/rust-diplomat/diplomat"
license = "MIT OR Apache-2.0"
categories = ["development-tools", "compilers"]
keywords = ["ffi", "codegen"]

[workspace.dependencies]
diplomat = { version = "0.9.0", path = "macro", default-features = false }
diplomat_core = { version = "0.9.0", path = "core", default-features = false }
diplomat-runtime = { version = "0.9.0", path = "runtime", default-features = false }
diplomat-tool = { version = "0.9.0", path = "tool", default-features = false }
19 changes: 7 additions & 12 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
[package]
name = "diplomat_core"
description = "Shared utilities between Diplomat macros and code generation"
version = "0.8.0"
version.workspace = true
rust-version.workspace = true
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/diplomat_core/"
edition = "2021"
keywords = ["ffi", "codegen"]
categories = ["development-tools"]
repository = "https://github.com/rust-diplomat/diplomat"
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true

[lib]
path = "src/lib.rs"
Expand Down
19 changes: 10 additions & 9 deletions example/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[package]
name = "diplomat-example"
version = "0.0.0"
publish = false
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2018"
version.workspace = true
rust-version.workspace = true
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true

[lib]
crate-type = ["staticlib", "rlib", "cdylib"]

[dependencies]
diplomat = { path = "../macro" }
diplomat-runtime = { path = "../runtime" }
diplomat.workspace = true
diplomat-runtime.workspace = true
icu = "1.2"
writeable = "0.5.2"
fixed_decimal = "0.5.3"
Expand Down
20 changes: 11 additions & 9 deletions feature_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
[package]
name = "diplomat-feature-tests"
version = "0.0.0"
publish = false
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2021"
version.workspace = true
rust-version.workspace = true
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true


[lib]
crate-type = ["staticlib", "rlib", "cdylib"]

[dependencies]
diplomat = { path = "../macro" }
diplomat-runtime = { path = "../runtime", feature = ["log", "jvm-callback-support"] }
diplomat.workspace = true
diplomat-runtime = { workspace = true, features = ["log", "jvm-callback-support"] }
log = { version = "0.4" }
21 changes: 8 additions & 13 deletions macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
[package]
name = "diplomat"
description = "The diplomat FFI generation macro"
version = "0.8.0"
version.workspace = true
rust-version.workspace = true
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2018"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/diplomat_core/"
keywords = ["ffi", "codegen"]
categories = ["development-tools"]
repository = "https://github.com/rust-diplomat/diplomat"
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true

[lib]
proc-macro = true
path = "src/lib.rs"

[dependencies]
diplomat_core = { path = "../core", version = "0.8.0" }
diplomat_core.workspace = true
syn = { version = "2.0", features = [ "full", "extra-traits" ] }
quote = "1.0"
proc-macro2 = "1.0.27"
Expand Down
10 changes: 5 additions & 5 deletions macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn gen_custom_trait_impl(custom_trait: &ast::Trait, custom_trait_struct_name: &I
} else {
let prime = "'".to_string();
let lifetime = lifetime.to_syn();
quote! { & #prime#lifetime }
quote! { & #prime #lifetime }
};
let mutability_mod = if *mutability == ast::Mutability::Mutable {
quote! {mut}
Expand All @@ -194,7 +194,7 @@ fn gen_custom_trait_impl(custom_trait: &ast::Trait, custom_trait_struct_name: &I
let runner_method_name =
Ident::new(&format!("run_{}_callback", method_name), Span::call_site());
methods.push(syn::Item::Fn(syn::parse_quote!(
fn #method_name#lifetimes (#(#param_names_and_types),*) #return_tokens {
fn #method_name #lifetimes (#(#param_names_and_types),*) #return_tokens {
unsafe {
#(#all_params_conversion)*
((self.vtable).#runner_method_name)(self.data #(#param_names)*)#end_token
Expand Down Expand Up @@ -331,7 +331,7 @@ fn gen_custom_type_method(strct: &ast::CustomType, m: &ast::Method) -> Item {
Item::Fn(syn::parse_quote! {
#[no_mangle]
#cfg
extern "C" fn #extern_ident#lifetimes(#(#all_params),*) #return_tokens {
extern "C" fn #extern_ident #lifetimes(#(#all_params),*) #return_tokens {
#(#all_params_conversion)*
#method_invocation(#(#all_params_names),*) #maybe_into
}
Expand All @@ -340,7 +340,7 @@ fn gen_custom_type_method(strct: &ast::CustomType, m: &ast::Method) -> Item {
Item::Fn(syn::parse_quote! {
#[no_mangle]
#cfg
extern "C" fn #extern_ident#lifetimes(#(#all_params),*) #return_tokens {
extern "C" fn #extern_ident #lifetimes(#(#all_params),*) #return_tokens {
#(#all_params_conversion)*
let ret = #method_invocation(#(#all_params_names),*);
#(#write_flushes)*
Expand Down Expand Up @@ -518,7 +518,7 @@ fn gen_bridge(mut input: ItemMod) -> ItemMod {
new_contents.push(Item::Fn(syn::parse_quote! {
#[no_mangle]
#cfg
extern "C" fn #destroy_ident#lifetime_defs(this: Box<#type_ident#lifetimes>) {}
extern "C" fn #destroy_ident #lifetime_defs(this: Box<#type_ident #lifetimes>) {}
}));
}
}
Expand Down
19 changes: 7 additions & 12 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
[package]
name = "diplomat-runtime"
description = "Common runtime utilities used by diplomat codegen"
version = "0.8.1"
version.workspace = true
rust-version.workspace = true
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2018"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/diplomat_core/"
keywords = ["ffi", "codegen"]
categories = ["development-tools"]
repository = "https://github.com/rust-diplomat/diplomat"
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true

[lib]
path = "src/lib.rs"
Expand Down
22 changes: 9 additions & 13 deletions tool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
[package]
name = "diplomat-tool"
description = "Tool for generating FFI bindings for various languages"
version = "0.8.0"
authors = [
"Shadaj Laddad <[email protected]>",
"Manish Goregaokar <[email protected]>",
"Quinn Okabayashi <[email protected]>"
]
edition = "2021"
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/diplomat_core/"
keywords = ["ffi", "codegen"]
categories = ["development-tools"]
repository = "https://github.com/rust-diplomat/diplomat"
version.workspace = true
rust-version.workspace = true
authors.workspace = true
categories.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true

[dependencies]
diplomat_core = { path = "../core", version = "0.8.0", features = ["displaydoc", "hir"] }
diplomat_core = { workspace = true, features = ["displaydoc", "hir"] }
syn = { version = "2", features = [ "full", "extra-traits" ] }
syn-inline-mod = "0.6.0"
quote = "1.0"
Expand Down