feat: build docs.rs documentation for Android (#654)

This commit is contained in:
Lucas Fernandes Nogueira
2023-10-19 17:39:54 +00:00
committed by GitHub
parent 5de23e79f9
commit d1b7c2c1fb
25 changed files with 113 additions and 29 deletions
+9 -1
View File
@@ -5,10 +5,15 @@ description = "Read and write to the system clipboard."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-clipboard-manager"
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
features = [ "dox" ]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-linux-android"
]
[build-dependencies]
tauri-build = { workspace = true }
@@ -22,3 +27,6 @@ thiserror = { workspace = true }
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
arboard = "3"
[features]
dox = [ "tauri/dox" ]
+4 -3
View File
@@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::process::exit;
fn main() {
if let Err(error) = tauri_build::mobile::PluginBuilder::new()
.android_path("android")
@@ -11,6 +9,9 @@ fn main() {
.run()
{
println!("{error:#}");
exit(1);
// when building documentation for Android the plugin build result is irrelevant to the crate itself
if !(cfg!(feature = "dox") && std::env::var("TARGET").unwrap().contains("android")) {
std::process::exit(1);
}
}
}