feat(tauri-plugin): add build::mobile::update_info_plist (#13888)

* feat(tauri-plugin): add build::mobile::update_info_plist

needed for https://github.com/tauri-apps/plugins-workspace/pull/2870

* Update .changes/update-info-plist.md
This commit is contained in:
Lucas Fernandes Nogueira
2025-07-25 07:50:24 -03:00
committed by GitHub
parent 91508c0b8d
commit a0113a8c64
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"tauri-plugin": minor:feat
---
Added `build::mobile::update_info_plist` to allow a plugin to update the iOS project Info.plist file.

View File

@@ -31,6 +31,23 @@ pub fn update_entitlements<F: FnOnce(&mut plist::Dictionary)>(f: F) -> Result<()
Ok(())
}
#[cfg(target_os = "macos")]
pub fn update_info_plist<F: FnOnce(&mut plist::Dictionary)>(f: F) -> Result<()> {
if let (Some(project_path), Ok(app_name)) = (
var_os("TAURI_IOS_PROJECT_PATH").map(PathBuf::from),
std::env::var("TAURI_IOS_APP_NAME"),
) {
update_plist_file(
project_path
.join(format!("{app_name}_iOS"))
.join("Info.plist"),
f,
)?;
}
Ok(())
}
pub fn update_android_manifest(block_identifier: &str, parent: &str, insert: String) -> Result<()> {
if let Some(project_path) = var_os("TAURI_ANDROID_PROJECT_PATH").map(PathBuf::from) {
let manifest_path = project_path.join("app/src/main/AndroidManifest.xml");