Skip to content

Commit 584eb61

Browse files
authored
fix: docs.rs (#1654)
* fix: docs.rs * fix updater docs * update build script
1 parent 7b053ba commit 584eb61

File tree

16 files changed

+69
-68
lines changed

16 files changed

+69
-68
lines changed

plugins/barcode-scanner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ links = "tauri-plugin-barcode-scanner"
1212
[package.metadata.docs.rs]
1313
rustc-args = [ "--cfg", "docsrs" ]
1414
rustdoc-args = [ "--cfg", "docsrs" ]
15-
targets = ["x86_64-linux-android"]
15+
targets = [ "x86_64-linux-android" ]
1616

1717
[build-dependencies]
1818
tauri-plugin = { workspace = true, features = [ "build" ] }

plugins/barcode-scanner/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ const COMMANDS: &[&str] = &[
1212
];
1313

1414
fn main() {
15-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
15+
let result = tauri_plugin::Builder::new(COMMANDS)
1616
.global_api_script_path("./api-iife.js")
1717
.android_path("android")
1818
.ios_path("ios")
19-
.try_build()
20-
{
21-
println!("{error:#}");
22-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
23-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
24-
std::process::exit(1);
25-
}
19+
.try_build();
20+
21+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
22+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
23+
result.unwrap();
2624
}
2725
}

plugins/biometric/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ links = "tauri-plugin-biometric"
1111
[package.metadata.docs.rs]
1212
rustc-args = [ "--cfg", "docsrs" ]
1313
rustdoc-args = [ "--cfg", "docsrs" ]
14+
targets = [ "x86_64-linux-android" ]
1415

1516
[build-dependencies]
1617
tauri-plugin = { workspace = true, features = [ "build" ] }

plugins/biometric/build.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
const COMMANDS: &[&str] = &["authenticate", "status"];
66

77
fn main() {
8-
tauri_plugin::Builder::new(COMMANDS)
8+
let result = tauri_plugin::Builder::new(COMMANDS)
99
.global_api_script_path("./api-iife.js")
1010
.android_path("android")
1111
.ios_path("ios")
12-
.build();
12+
.try_build();
13+
14+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
15+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
16+
result.unwrap();
17+
}
1318
}

plugins/clipboard-manager/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ const COMMANDS: &[&str] = &[
1212
];
1313

1414
fn main() {
15-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
15+
let result = tauri_plugin::Builder::new(COMMANDS)
1616
.global_api_script_path("./api-iife.js")
1717
.android_path("android")
1818
.ios_path("ios")
19-
.try_build()
20-
{
21-
println!("{error:#}");
22-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
23-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
24-
std::process::exit(1);
25-
}
19+
.try_build();
20+
21+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
22+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
23+
result.unwrap();
2624
}
2725
}

plugins/deep-link/build.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
3232
}
3333

3434
fn main() {
35-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
35+
let result = tauri_plugin::Builder::new(COMMANDS)
3636
.global_api_script_path("./api-iife.js")
3737
.android_path("android")
38-
.try_build()
39-
{
40-
println!("{error:#}");
41-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
42-
std::process::exit(1);
43-
}
38+
.try_build();
39+
40+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
41+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
42+
result.unwrap();
4443
}
4544

4645
if let Some(config) = tauri_plugin::plugin_config::<Config>("deep-link") {

plugins/dialog/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
const COMMANDS: &[&str] = &["open", "save", "message", "ask", "confirm"];
66

77
fn main() {
8-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
8+
let result = tauri_plugin::Builder::new(COMMANDS)
99
.global_api_script_path("./api-iife.js")
1010
.android_path("android")
1111
.ios_path("ios")
12-
.try_build()
13-
{
14-
println!("{error:#}");
15-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
16-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
17-
std::process::exit(1);
18-
}
12+
.try_build();
13+
14+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
15+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
16+
result.unwrap();
1917
}
2018
}

plugins/geolocation/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ links = "tauri-plugin-geolocation"
1111
[package.metadata.docs.rs]
1212
rustc-args = [ "--cfg", "docsrs" ]
1313
rustdoc-args = [ "--cfg", "docsrs" ]
14+
targets = [ "x86_64-linux-android" ]
1415

1516
[build-dependencies]
1617
tauri-plugin = { workspace = true, features = [ "build" ] }

plugins/geolocation/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ const COMMANDS: &[&str] = &[
1111
];
1212

1313
fn main() {
14-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
14+
let result = tauri_plugin::Builder::new(COMMANDS)
1515
.global_api_script_path("./api-iife.js")
1616
.android_path("android")
1717
.ios_path("ios")
18-
.try_build()
19-
{
20-
println!("{error:#}");
21-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
22-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
23-
std::process::exit(1);
24-
}
18+
.try_build();
19+
20+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
21+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
22+
result.unwrap();
2523
}
2624
}

plugins/haptics/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ links = "tauri-plugin-haptics"
1111
[package.metadata.docs.rs]
1212
rustc-args = [ "--cfg", "docsrs" ]
1313
rustdoc-args = [ "--cfg", "docsrs" ]
14+
targets = [ "x86_64-linux-android" ]
1415

1516
[build-dependencies]
1617
tauri-plugin = { workspace = true, features = [ "build" ] }

plugins/haptics/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ const COMMANDS: &[&str] = &[
1010
];
1111

1212
fn main() {
13-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
13+
let result = tauri_plugin::Builder::new(COMMANDS)
1414
.global_api_script_path("./api-iife.js")
1515
.android_path("android")
1616
.ios_path("ios")
17-
.try_build()
18-
{
19-
println!("{error:#}");
20-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
21-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
22-
std::process::exit(1);
23-
}
17+
.try_build();
18+
19+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
20+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
21+
result.unwrap();
2422
}
2523
}

plugins/nfc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ links = "tauri-plugin-nfc"
1111
[package.metadata.docs.rs]
1212
rustc-args = [ "--cfg", "docsrs" ]
1313
rustdoc-args = [ "--cfg", "docsrs" ]
14+
targets = [ "x86_64-linux-android" ]
1415

1516
[build-dependencies]
1617
tauri-plugin = { workspace = true, features = [ "build" ] }

plugins/nfc/build.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
const COMMANDS: &[&str] = &["is_available", "write", "scan"];
66

77
fn main() {
8-
tauri_plugin::Builder::new(COMMANDS)
8+
let result = tauri_plugin::Builder::new(COMMANDS)
99
.global_api_script_path("./api-iife.js")
1010
.android_path("android")
1111
.ios_path("ios")
12-
.build();
12+
.try_build();
13+
14+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
15+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
16+
result.unwrap();
17+
}
1318

1419
// TODO: triple check if this can reference the plugin's xml as it expects rn
1520
// TODO: This has to be configurable if we want to support handling nfc tags when the app is not open.

plugins/notification/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ const COMMANDS: &[&str] = &[
2222
];
2323

2424
fn main() {
25-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
25+
let result = tauri_plugin::Builder::new(COMMANDS)
2626
.global_api_script_path("./api-iife.js")
2727
.android_path("android")
2828
.ios_path("ios")
29-
.try_build()
30-
{
31-
println!("{error:#}");
32-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
33-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
34-
std::process::exit(1);
35-
}
29+
.try_build();
30+
31+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
32+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
33+
result.unwrap();
3634
}
3735
}

plugins/updater/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ links = "tauri-plugin-updater"
1212
[package.metadata.docs.rs]
1313
rustc-args = [ "--cfg", "docsrs" ]
1414
rustdoc-args = [ "--cfg", "docsrs" ]
15+
no-default-features = true
16+
features = [ "zip" ]
1517

1618
[build-dependencies]
1719
tauri-plugin = { workspace = true, features = [ "build" ] }

shared/template/build.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
const COMMANDS: &[&str] = &["execute"];
66

77
fn main() {
8-
if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
8+
let result = tauri_plugin::Builder::new(COMMANDS)
99
.global_api_script_path("./api-iife.js")
1010
.android_path("android")
1111
.ios_path("ios")
12-
.run()
13-
{
14-
println!("{error:#}");
15-
// when building documentation for Android the plugin build result is irrelevant to the crate itself
16-
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
17-
std::process::exit(1);
18-
}
12+
.try_build();
13+
14+
// when building documentation for Android the plugin build result is always Err() and is irrelevant to the crate documentation build
15+
if !(cfg!(docsrs) && std::env::var("TARGET").unwrap().contains("android")) {
16+
result.unwrap();
1917
}
2018
}

0 commit comments

Comments
 (0)