summaryrefslogtreecommitdiffstats
path: root/third_party/rust/uniffi/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /third_party/rust/uniffi/src
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/uniffi/src')
-rw-r--r--third_party/rust/uniffi/src/cli.rs21
-rw-r--r--third_party/rust/uniffi/src/lib.rs7
2 files changed, 20 insertions, 8 deletions
diff --git a/third_party/rust/uniffi/src/cli.rs b/third_party/rust/uniffi/src/cli.rs
index b2d3adc2ae..77d7f219a9 100644
--- a/third_party/rust/uniffi/src/cli.rs
+++ b/third_party/rust/uniffi/src/cli.rs
@@ -5,6 +5,7 @@
use camino::Utf8PathBuf;
use clap::{Parser, Subcommand};
use uniffi_bindgen::bindings::TargetLanguage;
+use uniffi_bindgen::BindingGeneratorDefault;
// Structs to help our cmdline parsing. Note that docstrings below form part
// of the "help" output.
@@ -35,7 +36,7 @@ enum Commands {
#[clap(long, short)]
no_format: bool,
- /// Path to the optional uniffi config file. If not provided, uniffi-bindgen will try to guess it from the UDL's file location.
+ /// Path to optional uniffi config file. This config is merged with the `uniffi.toml` config present in each crate, with its values taking precedence.
#[clap(long, short)]
config: Option<Utf8PathBuf>,
@@ -95,21 +96,29 @@ pub fn run_main() -> anyhow::Result<()> {
if lib_file.is_some() {
panic!("--lib-file is not compatible with --library.")
}
- if config.is_some() {
- panic!("--config is not compatible with --library. The config file(s) will be found automatically.")
- }
let out_dir = out_dir.expect("--out-dir is required when using --library");
if language.is_empty() {
panic!("please specify at least one language with --language")
}
uniffi_bindgen::library_mode::generate_bindings(
- &source, crate_name, &language, &out_dir, !no_format,
+ &source,
+ crate_name,
+ &BindingGeneratorDefault {
+ target_languages: language,
+ try_format_code: !no_format,
+ },
+ config.as_deref(),
+ &out_dir,
+ !no_format,
)?;
} else {
uniffi_bindgen::generate_bindings(
&source,
config.as_deref(),
- language,
+ BindingGeneratorDefault {
+ target_languages: language,
+ try_format_code: !no_format,
+ },
out_dir.as_deref(),
lib_file.as_deref(),
crate_name.as_deref(),
diff --git a/third_party/rust/uniffi/src/lib.rs b/third_party/rust/uniffi/src/lib.rs
index 0625bd9c66..319b3c7836 100644
--- a/third_party/rust/uniffi/src/lib.rs
+++ b/third_party/rust/uniffi/src/lib.rs
@@ -17,8 +17,11 @@ pub use uniffi_bindgen::bindings::ruby::run_test as ruby_run_test;
pub use uniffi_bindgen::bindings::swift::run_test as swift_run_test;
#[cfg(feature = "bindgen")]
pub use uniffi_bindgen::{
- bindings::TargetLanguage, generate_bindings, generate_component_scaffolding,
- generate_component_scaffolding_for_crate, print_repr,
+ bindings::kotlin::gen_kotlin::KotlinBindingGenerator,
+ bindings::python::gen_python::PythonBindingGenerator,
+ bindings::ruby::gen_ruby::RubyBindingGenerator,
+ bindings::swift::gen_swift::SwiftBindingGenerator, bindings::TargetLanguage, generate_bindings,
+ generate_component_scaffolding, generate_component_scaffolding_for_crate, print_repr,
};
#[cfg(feature = "build")]
pub use uniffi_build::{generate_scaffolding, generate_scaffolding_for_crate};