• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Plist not being updated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plist not being updated


  • Subject: Re: Plist not being updated
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 4 Dec 2007 18:42:24 -0800

On Dec 2, 2007, at 9:02 AM, Jerry Krinock wrote:

Summary:
Info.plist preprocessing does not watch relevant Build Settings.

Steps to Reproduce:
1. Create an Xcode Cocoa Application project
2. Turn on Info.plist preprocessing.
3. Use the build setting 'Current Project Version' in Info.plist
4. Build
5. Change the value of 'Current Project Version'
6. Build

Expected Results:
Info.plist preprocessing should run and write the new Current Project Version value into the product's Info.plist

You don't need to turn on Info.plist preprocessing just to have build settings expanded in your Info.plist file - build settings enclosed in ${} are always expanded in Info.plist files. Info.plist *also* runs the C preprocessor on your Info.plist file, which isn't something you necessarily want in most cases.


Now, even if you turn Info.plist preprocesing off, you'll *still* see the behavior you're seeing; it's nothing to do with Info.plist preprocessing, it's effectively a bug in analyzing the dependencies for an Info.plist file.

In general, I strongly recommend people *not* use Info.plist preprocessing unless it is *absolutely required* for how their project is structured. Applying a text-substitution preprocessor into your Info.plist means that it no longer valid XML or a valid plist, which means that you can't use any tools that know how to work with property lists or XML to manipulate it in ways that are guaranteed to be valid.

In almost all cases, what developers often try to do with Info.plist preprocessing can be handled without it by just doing the following two things:

(1) Follow recommended Mac OS X versioning techniques in one's Info.plist, and use CFBundleShortVersionString for the "marketing version" of your application or framework and CFBundleVersion for its "build version." This shows a version like "2.1 (100)" in the standard About panel above the string supplied by your NSHumanReadableCopyright Info.plist key. Increment the CFBundleVersion value whenever you're going to tag your sources in your SCM repository prior to building a release; setting your Versioning System to "Apple Generic" and using "agvtool new-version - all" will make at least the update-the-version part of this process very straightforward.

(2) Use build settings judiciously in your Info.plist files. For example, the current Xcode templates specify ${EXECUTABLE_NAME} and $ {PRODUCT_NAME} for the values of the CFBundleExecutable and CFBundleName Info.plist keys, respectively. If you have other values that vary based on project or target but otherwise share a common baseline Info.plist file, consider whether you really *need* to use #if/#else/#endif from the C preprocessor to do what you want, or if supplying different build settings from different targets will do what you need.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Plist not being updated
      • From: David Dunham <email@hidden>
References: 
 >Re: Plist not being updated (From: Alexander von Below <email@hidden>)
 >Re: Plist not being updated (From: Jerry Krinock <email@hidden>)

  • Prev by Date: How do I Expose functions in static library through a dylib without having to create a "wrapper" extern C fuction in a implementation file ?
  • Next by Date: Re: Plist not being updated
  • Previous by thread: Re: Plist not being updated
  • Next by thread: Re: Plist not being updated
  • Index(es):
    • Date
    • Thread