mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:57:16 +00:00
feat(codegen): fill app metadata in development Info.plist
This commit is contained in:
parent
2616ede410
commit
38f5db6e6a
7
.changes/dev-app-metadata.md
Normal file
7
.changes/dev-app-metadata.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
"tauri-codegen": patch
|
||||
"tauri-macros": patch
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Set the bundle name and app metadata in the Info.plist file in development mode.
|
||||
@ -1,7 +0,0 @@
|
||||
---
|
||||
"tauri-codegen": patch
|
||||
"tauri-macros": patch
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Set the bundle name in the Info.plist file in development mode.
|
||||
@ -31,6 +31,7 @@ png = "0.17"
|
||||
|
||||
[target."cfg(target_os = \"macos\")".dependencies]
|
||||
plist = "1"
|
||||
time = { version = "0.3", features = [ "parsing", "formatting" ] }
|
||||
|
||||
[features]
|
||||
default = [ "compression" ]
|
||||
|
||||
@ -293,9 +293,17 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
|
||||
plist::Value::Dictionary(Default::default())
|
||||
};
|
||||
|
||||
if let Some(dict) = info_plist.as_dictionary_mut() {
|
||||
if let Some(plist) = info_plist.as_dictionary_mut() {
|
||||
if let Some(product_name) = &config.package.product_name {
|
||||
dict.insert("CFBundleName".into(), product_name.clone().into());
|
||||
plist.insert("CFBundleName".into(), product_name.clone().into());
|
||||
}
|
||||
if let Some(version) = &config.package.version {
|
||||
plist.insert("CFBundleShortVersionString".into(), version.clone().into());
|
||||
}
|
||||
let format =
|
||||
time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
|
||||
if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
|
||||
plist.insert("CFBundleVersion".into(), build_number.into());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Commands",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -6,6 +6,10 @@
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"package": {
|
||||
"productName": "Hello World",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../../tooling/cli/schema.json",
|
||||
"package": {
|
||||
"productName": "isolation",
|
||||
"productName": "Isolation",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"build": {
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
"devPath": ["index.html"],
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Multi Window",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Navigation",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
"devPath": ["index.html"],
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Parent Window",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Resources",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "yarn package",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Sidecar",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -5,6 +5,10 @@
|
||||
"devPath": "dist",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Splashscreen",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "State",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
"beforeBuildCommand": "",
|
||||
"withGlobalTauri": true
|
||||
},
|
||||
"package": {
|
||||
"productName": "Streaming",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -6,6 +6,10 @@
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"package": {
|
||||
"productName": "Dynamic Lib",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
@ -6,6 +6,10 @@
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"package": {
|
||||
"productName": "Updater",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user