Skip to content

Commit eb65872

Browse files
feat: Add bundleVersion for iOS and macOS
1 parent c71755f commit eb65872

File tree

6 files changed

+59
-3
lines changed

6 files changed

+59
-3
lines changed

crates/tauri-bundler/src/bundle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub use self::{
1919
category::AppCategory,
2020
settings::{
2121
AppImageSettings, BundleBinary, BundleSettings, CustomSignCommandSettings, DebianSettings,
22-
DmgSettings, MacOsSettings, PackageSettings, PackageType, Position, RpmSettings, Settings,
23-
SettingsBuilder, Size, UpdaterSettings,
22+
DmgSettings, IosSettings, MacOsSettings, PackageSettings, PackageType, Position, RpmSettings,
23+
Settings, SettingsBuilder, Size, UpdaterSettings,
2424
},
2525
};
2626
#[cfg(target_os = "macos")]

crates/tauri-bundler/src/bundle/settings.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,13 @@ pub struct DmgSettings {
306306
pub application_folder_position: Position,
307307
}
308308

309+
/// The iOS bundle settings.
310+
#[derive(Clone, Debug, Default)]
311+
pub struct IosSettings {
312+
/// The version of the build that identifies an iteration of the bundle.
313+
pub bundle_version: Option<String>,
314+
}
315+
309316
/// The macOS bundle settings.
310317
#[derive(Clone, Debug, Default)]
311318
pub struct MacOsSettings {
@@ -323,6 +330,8 @@ pub struct MacOsSettings {
323330
/// List of custom files to add to the application bundle.
324331
/// Maps the path in the Contents directory in the app to the path of the file to include (relative to the current working directory).
325332
pub files: HashMap<PathBuf, PathBuf>,
333+
/// The version of the build that identifies an iteration of the bundle.
334+
pub bundle_version: Option<String>,
326335
/// A version string indicating the minimum MacOS version that the bundled app supports (e.g. `"10.11"`).
327336
/// If you are using this config field, you may also want have your `build.rs` script emit `cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=10.11`.
328337
pub minimum_system_version: Option<String>,
@@ -643,6 +652,8 @@ pub struct BundleSettings {
643652
pub rpm: RpmSettings,
644653
/// DMG-specific settings.
645654
pub dmg: DmgSettings,
655+
/// iOS-specific settings.
656+
pub ios: IosSettings,
646657
/// MacOS-specific settings.
647658
pub macos: MacOsSettings,
648659
/// Updater configuration.
@@ -1190,6 +1201,11 @@ impl Settings {
11901201
&self.bundle_settings.dmg
11911202
}
11921203

1204+
/// Returns the iOS settings.
1205+
pub fn ios(&self) -> &IosSettings {
1206+
&self.bundle_settings.ios
1207+
}
1208+
11931209
/// Returns the MacOS settings.
11941210
pub fn macos(&self) -> &MacOsSettings {
11951211
&self.bundle_settings.macos

crates/tauri-cli/config.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,13 @@
32923292
"type": "string"
32933293
}
32943294
},
3295+
"bundleVersion": {
3296+
"description": "The version of the build that identifies an iteration of the bundle.",
3297+
"type": [
3298+
"string",
3299+
"null"
3300+
]
3301+
},
32953302
"minimumSystemVersion": {
32963303
"description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.\n\n Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist`\n and the `MACOSX_DEPLOYMENT_TARGET` environment variable.\n\n An empty string is considered an invalid value so the default value is used.",
32973304
"default": "10.13",
@@ -3493,6 +3500,13 @@
34933500
"null"
34943501
]
34953502
},
3503+
"bundleVersion": {
3504+
"description": "The version of the build that identifies an iteration of the bundle.",
3505+
"type": [
3506+
"string",
3507+
"null"
3508+
]
3509+
},
34963510
"minimumSystemVersion": {
34973511
"description": "A version string indicating the minimum iOS version that the bundled application supports. Defaults to `13.0`.\n\n Maps to the IPHONEOS_DEPLOYMENT_TARGET value.",
34983512
"default": "13.0",

crates/tauri-cli/src/interface/rust.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use notify_debouncer_full::new_debouncer;
2222
use serde::{Deserialize, Deserializer};
2323
use tauri_bundler::{
2424
AppCategory, AppImageSettings, BundleBinary, BundleSettings, DebianSettings, DmgSettings,
25-
MacOsSettings, PackageSettings, Position, RpmSettings, Size, UpdaterSettings, WindowsSettings,
25+
IosSettings, MacOsSettings, PackageSettings, Position, RpmSettings, Size, UpdaterSettings, WindowsSettings,
2626
};
2727
use tauri_utils::config::{parse::is_configuration_file, DeepLinkProtocol, Updater};
2828

@@ -1418,9 +1418,13 @@ fn tauri_config_to_bundle_settings(
14181418
y: config.macos.dmg.application_folder_position.y,
14191419
},
14201420
},
1421+
ios: IosSettings {
1422+
bundle_version: config.ios.bundle_version,
1423+
},
14211424
macos: MacOsSettings {
14221425
frameworks: config.macos.frameworks,
14231426
files: config.macos.files,
1427+
bundle_version: config.macos.bundle_version,
14241428
minimum_system_version: config.macos.minimum_system_version,
14251429
exception_domain: config.macos.exception_domain,
14261430
signing_identity,

crates/tauri-schema-generator/schemas/config.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,13 @@
32923292
"type": "string"
32933293
}
32943294
},
3295+
"bundleVersion": {
3296+
"description": "The version of the build that identifies an iteration of the bundle.",
3297+
"type": [
3298+
"string",
3299+
"null"
3300+
]
3301+
},
32953302
"minimumSystemVersion": {
32963303
"description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.\n\n Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist`\n and the `MACOSX_DEPLOYMENT_TARGET` environment variable.\n\n An empty string is considered an invalid value so the default value is used.",
32973304
"default": "10.13",
@@ -3493,6 +3500,13 @@
34933500
"null"
34943501
]
34953502
},
3503+
"bundleVersion": {
3504+
"description": "The version of the build that identifies an iteration of the bundle.",
3505+
"type": [
3506+
"string",
3507+
"null"
3508+
]
3509+
},
34963510
"minimumSystemVersion": {
34973511
"description": "A version string indicating the minimum iOS version that the bundled application supports. Defaults to `13.0`.\n\n Maps to the IPHONEOS_DEPLOYMENT_TARGET value.",
34983512
"default": "13.0",

crates/tauri-utils/src/config.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ pub struct MacConfig {
612612
/// The files to include in the application relative to the Contents directory.
613613
#[serde(default)]
614614
pub files: HashMap<PathBuf, PathBuf>,
615+
/// The version of the build that identifies an iteration of the bundle.
616+
#[serde(alias = "bundle-version")]
617+
pub bundle_version: Option<String>,
615618
/// A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.
616619
///
617620
/// Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist`
@@ -651,6 +654,7 @@ impl Default for MacConfig {
651654
Self {
652655
frameworks: None,
653656
files: HashMap::new(),
657+
bundle_version: None,
654658
minimum_system_version: macos_minimum_system_version(),
655659
exception_domain: None,
656660
signing_identity: None,
@@ -2522,6 +2526,9 @@ pub struct IosConfig {
25222526
/// The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.
25232527
#[serde(alias = "development-team")]
25242528
pub development_team: Option<String>,
2529+
/// The version of the build that identifies an iteration of the bundle.
2530+
#[serde(alias = "bundle-version")]
2531+
pub bundle_version: Option<String>,
25252532
/// A version string indicating the minimum iOS version that the bundled application supports. Defaults to `13.0`.
25262533
///
25272534
/// Maps to the IPHONEOS_DEPLOYMENT_TARGET value.
@@ -2538,6 +2545,7 @@ impl Default for IosConfig {
25382545
template: None,
25392546
frameworks: None,
25402547
development_team: None,
2548+
bundle_version: None,
25412549
minimum_system_version: ios_minimum_system_version(),
25422550
}
25432551
}

0 commit comments

Comments
 (0)