File tree 4 files changed +16
-9
lines changed
4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -191,12 +191,6 @@ fn create_info_plist(
191
191
bundle_icon_file : Option < PathBuf > ,
192
192
settings : & Settings ,
193
193
) -> crate :: Result < ( ) > {
194
- let format = time:: format_description:: parse ( "[year][month][day].[hour][minute][second]" )
195
- . map_err ( time:: error:: Error :: from) ?;
196
- let build_number = time:: OffsetDateTime :: now_utc ( )
197
- . format ( & format)
198
- . map_err ( time:: error:: Error :: from) ?;
199
-
200
194
let mut plist = plist:: Dictionary :: new ( ) ;
201
195
plist. insert ( "CFBundleDevelopmentRegion" . into ( ) , "English" . into ( ) ) ;
202
196
plist. insert ( "CFBundleDisplayName" . into ( ) , settings. product_name ( ) . into ( ) ) ;
@@ -226,7 +220,7 @@ fn create_info_plist(
226
220
"CFBundleShortVersionString" . into ( ) ,
227
221
settings. version_string ( ) . into ( ) ,
228
222
) ;
229
- plist. insert ( "CFBundleVersion" . into ( ) , build_number . into ( ) ) ;
223
+ plist. insert ( "CFBundleVersion" . into ( ) , settings . bundle_version ( ) . unwrap_or_else ( || settings . version_string ( ) ) . into ( ) ) ;
230
224
plist. insert ( "CSResourcesFileMapped" . into ( ) , true . into ( ) ) ;
231
225
if let Some ( category) = settings. app_category ( ) {
232
226
plist. insert (
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ fn generate_info_plist(
178
178
writeln ! (
179
179
file,
180
180
" <key>CFBundleVersion</key>\n <string>{}</string>" ,
181
- settings. version_string( )
181
+ settings. bundle_version ( ) . unwrap_or_else ( || settings . version_string( ) )
182
182
) ?;
183
183
writeln ! (
184
184
file,
Original file line number Diff line number Diff line change @@ -1104,6 +1104,18 @@ impl Settings {
1104
1104
& self . package . version
1105
1105
}
1106
1106
1107
+ /// Returns the bundle version.
1108
+ pub fn bundle_version ( & self ) -> Option < & str > {
1109
+ #[ cfg( target_os = "ios" ) ]
1110
+ {
1111
+ self . bundle_settings . ios . bundle_version . as_deref ( )
1112
+ }
1113
+ #[ cfg( target_os = "macos" ) ]
1114
+ {
1115
+ self . bundle_settings . macos . bundle_version . as_deref ( )
1116
+ }
1117
+ }
1118
+
1107
1119
/// Returns the copyright text.
1108
1120
pub fn copyright_string ( & self ) -> Option < & str > {
1109
1121
self . bundle_settings . copyright . as_deref ( )
Original file line number Diff line number Diff line change @@ -313,8 +313,9 @@ pub fn context_codegen(data: ContextData) -> EmbeddedAssetsResult<TokenStream> {
313
313
plist. insert ( "CFBundleName" . into ( ) , product_name. clone ( ) . into ( ) ) ;
314
314
}
315
315
if let Some ( version) = & config. version {
316
+ let bundle_version = & config. bundle . macos . bundle_version ;
316
317
plist. insert ( "CFBundleShortVersionString" . into ( ) , version. clone ( ) . into ( ) ) ;
317
- plist. insert ( "CFBundleVersion" . into ( ) , version. clone ( ) . into ( ) ) ;
318
+ plist. insert ( "CFBundleVersion" . into ( ) , bundle_version . clone ( ) . unwrap_or_else ( || version. clone ( ) ) . into ( ) ) ;
318
319
}
319
320
}
320
321
You can’t perform that action at this time.
0 commit comments