Skip to content

Commit

Permalink
feat(ios): add empty entitlements file to iOS project (#7445)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog authored Jul 18, 2023
1 parent c7dacca commit aa94f71
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
6 changes: 6 additions & 0 deletions .changes/ios-entitlements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"tauri-cli": patch:feat
"@tauri-apps/cli": patch:feat
---

Generate empty entitlements file for the iOS project.
1 change: 0 additions & 1 deletion tooling/bundler/src/bundle/macos/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use crate::Settings;

use anyhow::Context;
use log::{info, warn};
use tauri_utils::config::BundleTypeRole;

use std::{
fs,
Expand Down
27 changes: 6 additions & 21 deletions tooling/cli/src/mobile/ios/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
3 changes: 3 additions & 0 deletions tooling/cli/templates/mobile/ios/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ targets:
- path: Sources
- path: Assets.xcassets
- path: Externals
- path: {{app.name}}_iOS
- path: {{app.asset-dir}}
buildPhase: resources
type: folder
Expand All @@ -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
Expand Down

0 comments on commit aa94f71

Please sign in to comment.