xcode info.plist build variable ${PRODUCT_NAME:rfc1034identifier} seems completely undocumented?

Hack Saw picture Hack Saw · Mar 2, 2011 · Viewed 12.1k times · Source

I'm trying to find documentation that describe the syntax and possibilities suggested by the construction ${PRODUCT_NAME:rfc1034identifier}. Obviously this turns into some version of the product name, but where is the documentation that describes how? I just grepped the entire /Developer directory, and got nothing useful.

I'm not looking for the narrow definition of what happens to this particular variable, I want to know about all such modifiers like rfc1034identifier.

Answer

Ivan Vučica picture Ivan Vučica · Jun 7, 2011

By using strings I also dug out the following things that look like they're related to :rfc1034identifier:

  • :quote - adds backslashes before whitespaces (and more), for use in shell scripts
  • :identifier - replaces whitespace, slashes (and more) with underscores
  • :rfc1034identifier - replaces whitespace, slashes (and more) with dashes
  • :dir - don't know, observed replace with ./ in some cases
  • :abs - don't know

Exact command:

strings /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/DevToolsCore|grep '^:'

There are more things that look like interesting modifiers (for example, :char-range=%@), but I couldn't get these to work. There's only one example of :char-range on the net, and it's from a crash log for Xcode.

Someone asked how do we know it's a modifier specification. Well, we know because it works on multiple variables in build settings. Plist preprocessor probably uses the same mechanisms to resolve build variables as does the build system.

Hack Saw, if you get a response via that bug report, don't forget to keep us informed :-)