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

This commit is contained in:
Lucas Fernandes Nogueira
2023-10-19 14:39:54 -03:00
committed by GitHub
parent 5de23e79f9
commit d1b7c2c1fb
25 changed files with 113 additions and 29 deletions
+1
View File
@@ -5,6 +5,7 @@ description = "APIs to read application metadata and change app visibility on ma
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+8
View File
@@ -5,8 +5,13 @@ description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-barcode-scanner"
[package.metadata.docs.rs]
features = [ "dox" ]
targets = [ "x86_64-linux-android" ]
[build-dependencies]
tauri-build = { workspace = true }
@@ -16,3 +21,6 @@ serde_json = { workspace = true }
tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
[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);
}
}
}
+1
View File
@@ -5,6 +5,7 @@ description = "Parse arguments from your Tauri application's command line interf
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+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);
}
}
}
+7
View File
@@ -8,6 +8,10 @@ edition = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-deep-link"
[package.metadata.docs.rs]
features = [ "dox" ]
targets = [ "x86_64-linux-android" ]
[build-dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
@@ -20,3 +24,6 @@ tauri = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
url = "2"
[features]
dox = [ "tauri/dox" ]
+3 -3
View File
@@ -2,8 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
use std::process::exit;
#[path = "src/config.rs"]
mod config;
use config::{AssociatedDomain, Config};
@@ -37,7 +35,9 @@ fn main() {
.run()
{
println!("{error:#}");
exit(1);
if !(cfg!(feature = "dox") && std::env::var("TARGET").unwrap().contains("android")) {
std::process::exit(1);
}
}
if let Some(config) = tauri_build::config::plugin_config::<Config>("deep-link") {
+9 -1
View File
@@ -5,10 +5,15 @@ description = "Native system dialogs for opening and saving files along with mes
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-dialog"
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
features = [ "dox" ]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-linux-android"
]
[dependencies]
serde = { workspace = true }
@@ -27,3 +32,6 @@ raw-window-handle = "0.5"
[build-dependencies]
tauri-build = { workspace = true }
[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);
}
}
}
+2 -2
View File
@@ -129,7 +129,7 @@ pub struct MessageDialogBuilder<R: Runtime> {
#[cfg(mobile)]
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MessageDialogPayload<'a> {
pub(crate) struct MessageDialogPayload<'a> {
title: &'a String,
message: &'a String,
kind: &'a MessageDialogKind,
@@ -272,7 +272,7 @@ pub struct FileDialogBuilder<R: Runtime> {
#[cfg(mobile)]
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct FileDialogPayload<'a> {
pub(crate) struct FileDialogPayload<'a> {
filters: &'a Vec<Filter>,
multiple: bool,
}
+1
View File
@@ -5,6 +5,7 @@ description = "Register global hotkeys listeners on your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+1
View File
@@ -5,6 +5,7 @@ description = "Access an HTTP client written in Rust."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+7 -1
View File
@@ -5,10 +5,15 @@ description = "Send desktop and mobile notifications on your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
links = "tauri-plugin-notification"
[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 }
@@ -32,3 +37,4 @@ win7-notifications = { version = "0.3.1", optional = true }
[features]
windows7-compat = [ "win7-notifications" ]
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);
}
}
}
+1
View File
@@ -5,6 +5,7 @@ description = "Read information about the operating system."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+1
View File
@@ -5,6 +5,7 @@ description = "Access the current process of your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+1
View File
@@ -5,6 +5,7 @@ description = "Access the system shell. Allows you to spawn child processes and
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+1
View File
@@ -5,6 +5,7 @@ description = "In-app updates for Tauri applications."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]
+1 -1
View File
@@ -435,7 +435,7 @@ impl Update {
self.install(bytes)
}
#[cfg(any(target_os = "android", target_os = "ios"))]
#[cfg(mobile)]
fn install_inner(&self, bytes: Vec<u8>) -> Result<()> {
Ok(())
}
+1
View File
@@ -5,6 +5,7 @@ description = "Interact with the Tauri window."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "tauri/dox" ]