mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
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:
committed by
GitHub
parent
91508c0b8d
commit
a0113a8c64
5
.changes/update-info-plist.md
Normal file
5
.changes/update-info-plist.md
Normal 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.
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user