From 8817531d03bf8155b95b3208ff1c51f607730afa Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 22 Nov 2024 17:17:34 -0800 Subject: [PATCH] Bump diplomat to 0.9.0 --- Cargo.lock | 12 ++++++------ Cargo.toml | 23 +++++++++++++++++++++-- core/Cargo.toml | 19 +++++++------------ example/Cargo.toml | 19 ++++++++++--------- feature_tests/Cargo.toml | 20 +++++++++++--------- macro/Cargo.toml | 21 ++++++++------------- macro/src/lib.rs | 10 +++++----- runtime/Cargo.toml | 19 +++++++------------ tool/Cargo.toml | 22 +++++++++------------- 9 files changed, 84 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f5647854..ec152c0fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "diplomat" -version = "0.8.0" +version = "0.9.0" dependencies = [ "diplomat_core", "insta", @@ -365,7 +365,7 @@ dependencies = [ [[package]] name = "diplomat-example" -version = "0.0.0" +version = "0.9.0" dependencies = [ "criterion", "diplomat", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "diplomat-feature-tests" -version = "0.0.0" +version = "0.9.0" dependencies = [ "diplomat", "diplomat-runtime", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "diplomat-runtime" -version = "0.8.1" +version = "0.9.0" dependencies = [ "jni", "log", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "diplomat-tool" -version = "0.8.0" +version = "0.9.0" dependencies = [ "askama", "clap", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "diplomat_core" -version = "0.8.0" +version = "0.9.0" dependencies = [ "displaydoc", "either", diff --git a/Cargo.toml b/Cargo.toml index 008fcd024..09f7049db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,4 @@ [workspace] -# Applies to diplomat-core, diplomat, and diplomat-runtime -# Diplomat-tool has no MSRV for now resolver = "2" members = [ "core", @@ -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 ", + "Manish Goregaokar ", + "Quinn Okabayashi " +] +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 } diff --git a/core/Cargo.toml b/core/Cargo.toml index 7bfe66930..151e5f6dc 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -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 ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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" diff --git a/example/Cargo.toml b/example/Cargo.toml index 3f835283e..a76db434f 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -1,20 +1,21 @@ [package] name = "diplomat-example" -version = "0.0.0" publish = false -authors = [ - "Shadaj Laddad ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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" diff --git a/feature_tests/Cargo.toml b/feature_tests/Cargo.toml index 710f2434d..fac4b1428 100644 --- a/feature_tests/Cargo.toml +++ b/feature_tests/Cargo.toml @@ -1,18 +1,20 @@ [package] name = "diplomat-feature-tests" -version = "0.0.0" publish = false -authors = [ - "Shadaj Laddad ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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" } diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 973c44a3f..72caa9057 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -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 ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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" diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 460c7ae71..b04043ab3 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -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} @@ -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 @@ -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 } @@ -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)* @@ -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>) {} })); } } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 4a35725a1..ad8740322 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -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 ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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" diff --git a/tool/Cargo.toml b/tool/Cargo.toml index 0bc0123c8..536cc6e65 100644 --- a/tool/Cargo.toml +++ b/tool/Cargo.toml @@ -1,21 +1,17 @@ [package] name = "diplomat-tool" description = "Tool for generating FFI bindings for various languages" -version = "0.8.0" -authors = [ - "Shadaj Laddad ", - "Manish Goregaokar ", - "Quinn Okabayashi " -] -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"