diff --git a/.changes/ios-entitlements.md b/.changes/ios-entitlements.md new file mode 100644 index 000000000000..5bf13ff57098 --- /dev/null +++ b/.changes/ios-entitlements.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:feat +"@tauri-apps/cli": patch:feat +--- + +Generate empty entitlements file for the iOS project. diff --git a/tooling/bundler/src/bundle/macos/app.rs b/tooling/bundler/src/bundle/macos/app.rs index 5b22cbbb50b5..9defdb96a393 100644 --- a/tooling/bundler/src/bundle/macos/app.rs +++ b/tooling/bundler/src/bundle/macos/app.rs @@ -31,7 +31,6 @@ use crate::Settings; use anyhow::Context; use log::{info, warn}; -use tauri_utils::config::BundleTypeRole; use std::{ fs, diff --git a/tooling/cli/src/mobile/ios/project.rs b/tooling/cli/src/mobile/ios/project.rs index 4b83cd5899e9..d1b1a74171c1 100644 --- a/tooling/cli/src/mobile/ios/project.rs +++ b/tooling/cli/src/mobile/ios/project.rs @@ -164,28 +164,13 @@ pub fn gen( ) .with_context(|| "failed to process template")?; - let asset_dir = dest.join(DEFAULT_ASSET_DIR); - if !asset_dir.is_dir() { - create_dir_all(&asset_dir).map_err(|cause| { - anyhow::anyhow!( - "failed to create asset dir {path}: {cause}", - path = asset_dir.display() - ) - })?; - } - - let externals_dir = dest.join("Externals"); - if !externals_dir.is_dir() { - create_dir_all(&externals_dir).map_err(|cause| { - anyhow::anyhow!( - "failed to create Externals dir {path}: {cause}", - path = externals_dir.display() - ) - })?; - } + let mut dirs_to_create = asset_catalogs.to_vec(); + dirs_to_create.push(dest.join(DEFAULT_ASSET_DIR)); + dirs_to_create.push(dest.join("Externals")); + dirs_to_create.push(dest.join(format!("{}_iOS", config.app().name()))); - // Create all asset catalog directories if they don't already exist - for dir in asset_catalogs { + // Create all required project directories if they don't already exist + for dir in &dirs_to_create { std::fs::create_dir_all(dir).map_err(|cause| { anyhow::anyhow!( "failed to create directory at {path}: {cause}", diff --git a/tooling/cli/templates/mobile/ios/project.yml b/tooling/cli/templates/mobile/ios/project.yml index 8d98197cf58a..1caacb1e26b7 100644 --- a/tooling/cli/templates/mobile/ios/project.yml +++ b/tooling/cli/templates/mobile/ios/project.yml @@ -32,6 +32,7 @@ targets: - path: Sources - path: Assets.xcassets - path: Externals + - path: {{app.name}}_iOS - path: {{app.asset-dir}} buildPhase: resources type: folder @@ -58,6 +59,8 @@ targets: CFBundleVersion: {{apple.bundle-version}} {{~#each apple.plist-pairs}} {{this.key}}: {{this.value}}{{/each}} + entitlements: + path: {{app.name}}_iOS/{{app.name}}_iOS.entitlements scheme: environmentVariables: RUST_BACKTRACE: full