mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-20 23:11:24 +02:00
* feat(clipboard-manager): add support for writing secrets add `write_secret` command that writes a text into the clipboard and hints clipboard managers to not save the text. uses `arboard`'s `SetExtLinux`, `SetExtWindows`, and `SetExtApple` extensions for each platform. * fix(clipboard-manager): require arboard 3.6 * chore(clipboard-manager): add license header to secret.rs * fix(clipboard-manager): only exclude from monitoring on Windows * refactor(clipboard-manager): replace ExcludeSecret trait with a function * chore(clipboard-manager): drop redundant cfg(desktop) in desktop.rs * refactor(clipboard-manager): share clipboard access in a helper * feat(clipboard-manager): implement write_secret on Android and iOS * docs(clipboard-manager): document writeSecret * chore(clipboard-manager): add change file for writeSecret * test(clipboard-manager): cover writeSecret in e2e --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
30 lines
920 B
Rust
30 lines
920 B
Rust
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
const COMMANDS: &[&str] = &[
|
|
"write_text",
|
|
"read_text",
|
|
"write_image",
|
|
"read_image",
|
|
"write_html",
|
|
"clear",
|
|
"write_secret",
|
|
];
|
|
|
|
fn main() {
|
|
let result = tauri_plugin::Builder::new(COMMANDS)
|
|
.global_api_script_path("./api-iife.js")
|
|
.android_path("android")
|
|
.ios_path("ios")
|
|
.try_build();
|
|
|
|
// when building documentation for Android the plugin build result is always Err() (docs.rs mounts the sources read-only) and is irrelevant to the crate documentation build
|
|
// `cfg(docsrs)` only reaches rustdoc, build scripts must check the `DOCS_RS` env var instead
|
|
if !(std::env::var_os("DOCS_RS").is_some()
|
|
&& std::env::var("TARGET").unwrap().contains("android"))
|
|
{
|
|
result.unwrap();
|
|
}
|
|
}
|