3

I have just been looking around for a method to add a buildDate and buildNumber to my projects (which I found) but I was a bit puzzled that most suggested adding properties to the info.plist called CFBuildDate and CFBuildNumber.

EDIT:

Do these properties start with CF because:

  1. They belong to Core Foundation and thats the convention?
  2. They are not part of CF, but the convention is to use CF anyways?
  3. They can be called anything, CF just makes them match the other CF keys?
  4. It does not matter, call them what you want.
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
  • Why do you want to include these into your project? Do you want to be able to tell what build you're you're running from within your app? Is it for another reason? – Jessedc Sep 17 '12 at 11:27
  • Just so that I can tag the apps on our iPhones to identify the version and build date. For release I usually update this manually, but whilst developing I wanted it burned into the app each time I compiled for simplicity. – fuzzygoat Sep 17 '12 at 12:25
  • 1
    slightly off-topic, I normally run a post-build script that auto-increment buildNumber for every re-compile. buildDate I typically use the executable.app last-modified date (ie: no buildDate in info.plist). – dklt Sep 21 '12 at 09:54

2 Answers2

1

When I asked myself this question I got my original information from something similar to this post which talks about using CFBuildNumber and CFBuildDate and provides some clever scripting ideas to generate them.

After an exhaustive search I couldn't find any official Apple documentation on the use of CFBuildNUmber/CFBuildDate in any iOS project or recent OSX projects. The Information Property List Key Reference (Core Foundation Keys) also has no reference to them so my conclusion was they aren't official and just use CF as a prefix to be similar to the existing Core Foundation keys.

To your questions I believe #2, #3 and #4 (as you suspected) are the case due to lack of any official Apple documentation on the two keys.

  • They are not part of CF; the convention is to use CF anyway.
  • They can be called anything; CF just makes them match the other CF keys.
  • Their name doesn't matter, they can be called what you want.

I can't speak for OSX development, but from the iOS side the two keys provided for these purposes are CFBundleShortVersionString and CFBundleVersion. The former being the short App Store visible version and the later being the extended version with addition digits if required.

I use a build number generated by a CI server and append it to the end of theCFBundleVersion key at compile time. If you wanted to add the date you could add it to the same key.

Community
  • 1
  • 1
Jessedc
  • 12,320
  • 3
  • 50
  • 63
0

The Core Foundation framework provides the underlying infrastructure for bundles, including the code used at runtime to load bundles and parse their structure. As a result, many of the keys recognized by this framework are fundamental to the definition of bundles themselves and are instrumental in determining the contents of a bundle.

Core Foundation keys use the prefix CF to distinguish them from other keys.

For More and detail info See This...

Wolverine
  • 4,264
  • 1
  • 27
  • 49
  • So CFBuildDate and CFBuildNumber have nothing to do with Core Foundation, the thinking is that seeing as they are in info.plist with other CF keys it would be nice it they matched to look pretty (even though its confusing)? – fuzzygoat Sep 13 '12 at 13:51
  • Core Foundation is a framework that provides fundamental software services useful to application services, application environments. Core Foundation also provides abstractions for common data types, facilitates internationalization with Unicode string storage, and offers a suite of utilities such as plug-in support, XML property lists, URL resource access, and preferences. These keys are interrelated with core foundation....Without Core foundation, We can not think to achieve functionality for which these key are being used. – Wolverine Sep 13 '12 at 14:05
  • Sure I understand that, but what I am getting at is that CFBuildDate (and CFBuildNumber) are not listed as far as I can see as CF keys even though they are named as such. – fuzzygoat Sep 13 '12 at 14:22
  • The OP gives no indication that they are struggling with what CoreFoundation actually is or does. – Jessedc Sep 17 '12 at 11:49