fix(cli): synchronize version with iOS Info.plist (#10944)

This commit is contained in:
Lucas Fernandes Nogueira
2024-09-10 12:31:15 -03:00
committed by GitHub
parent fafceec309
commit a5848af65b
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"tauri-cli": patch:bug
"@tauri-apps/cli": patch:bug
---
Synchronize app version (`tauri.conf.json > version` or `Cargo.toml > package > version`) with the `CFBundleVersion` and `CFBundleShortVersionString` Info.plist values.

View File

@@ -174,6 +174,11 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
)?;
inject_resources(&config, tauri_config.lock().unwrap().as_ref().unwrap())?;
let mut plist = plist::Dictionary::new();
let version = interface.app_settings().get_package_settings().version;
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
plist.insert("CFBundleVersion".into(), version.into());
let info_plist_path = config
.project_dir()
.join(config.scheme())
@@ -182,6 +187,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
info_plist_path.clone().into(),
tauri_path.join("Info.plist").into(),
tauri_path.join("Info.ios.plist").into(),
plist::Value::Dictionary(plist).into(),
])?;
merged_info_plist.to_file_xml(&info_plist_path)?;