mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
add. build script
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -8837,6 +8837,7 @@ dependencies = [
|
||||
"glob",
|
||||
"heck 0.5.0",
|
||||
"json-patch",
|
||||
"napi-build-ohos",
|
||||
"quote",
|
||||
"schemars",
|
||||
"semver",
|
||||
|
||||
@@ -47,6 +47,9 @@ toml = "0.9"
|
||||
# Our code requires at least 0.8.21 so don't simplify this to 0.8
|
||||
schemars = { version = "0.8.21", features = ["preserve_order"] }
|
||||
|
||||
[target.'cfg(target_env = "ohos")'.dependencies]
|
||||
napi-build-ohos = { version = "1.1" }
|
||||
|
||||
[features]
|
||||
default = ["config-json"]
|
||||
codegen = ["tauri-codegen", "quote"]
|
||||
|
||||
@@ -460,6 +460,9 @@ pub fn build() {
|
||||
pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
use anyhow::anyhow;
|
||||
|
||||
#[cfg(target_env = "ohos")]
|
||||
napi_build_ohos::setup();
|
||||
|
||||
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
|
||||
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
|
||||
@@ -83,7 +83,7 @@ pub fn entry_point(_attributes: TokenStream, item: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
// be careful when renaming this, the `start_app` symbol is checked by the CLI
|
||||
#[cfg(not(target_os = "android"))]
|
||||
#[cfg(target_os = "ios")]
|
||||
#[no_mangle]
|
||||
#[inline(never)]
|
||||
pub extern "C" fn start_app() {
|
||||
|
||||
@@ -2174,7 +2174,7 @@ tauri::Builder::default()
|
||||
app: crate::ohos::APP
|
||||
.lock()
|
||||
.unwrap()
|
||||
.take()
|
||||
.clone()
|
||||
.expect("OpenHarmony app instance not initialized"),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user