File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Expand file tree Collapse file tree 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(
191191 bundle_icon_file : Option < PathBuf > ,
192192 settings : & Settings ,
193193) -> 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-
200194 let mut plist = plist:: Dictionary :: new ( ) ;
201195 plist. insert ( "CFBundleDevelopmentRegion" . into ( ) , "English" . into ( ) ) ;
202196 plist. insert ( "CFBundleDisplayName" . into ( ) , settings. product_name ( ) . into ( ) ) ;
@@ -226,7 +220,7 @@ fn create_info_plist(
226220 "CFBundleShortVersionString" . into ( ) ,
227221 settings. version_string ( ) . into ( ) ,
228222 ) ;
229- plist. insert ( "CFBundleVersion" . into ( ) , build_number . into ( ) ) ;
223+ plist. insert ( "CFBundleVersion" . into ( ) , settings . bundle_version ( ) . unwrap_or_else ( || settings . version_string ( ) ) . into ( ) ) ;
230224 plist. insert ( "CSResourcesFileMapped" . into ( ) , true . into ( ) ) ;
231225 if let Some ( category) = settings. app_category ( ) {
232226 plist. insert (
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ fn generate_info_plist(
178178 writeln ! (
179179 file,
180180 " <key>CFBundleVersion</key>\n <string>{}</string>" ,
181- settings. version_string( )
181+ settings. bundle_version ( ) . unwrap_or_else ( || settings . version_string( ) )
182182 ) ?;
183183 writeln ! (
184184 file,
Original file line number Diff line number Diff line change @@ -1104,6 +1104,18 @@ impl Settings {
11041104 & self . package . version
11051105 }
11061106
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+
11071119 /// Returns the copyright text.
11081120 pub fn copyright_string ( & self ) -> Option < & str > {
11091121 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> {
313313 plist. insert ( "CFBundleName" . into ( ) , product_name. clone ( ) . into ( ) ) ;
314314 }
315315 if let Some ( version) = & config. version {
316+ let bundle_version = & config. bundle . macos . bundle_version ;
316317 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 ( ) ) ;
318319 }
319320 }
320321
You can’t perform that action at this time.
0 commit comments