What are the build customization modifiers in Xcode?

I saw some build settings that are used as

$ (PRODUCT_NAME: identifier)

Usage: upper also makes the parameter value in upper case, but I do not know what they call and cannot find any documentation. Does anyone know their name or where should the documentation use them correctly?

+6
source share
2 answers

There is a bunch in /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/DevToolsCore in the file:

 [ 09:22 root@MacBookPro / ]# strings /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/DevToolsCore | egrep "(^:|^[a-z0-9]+$)" :children.count=%lu :name='%@' :File='%@':Line=%lu:RefType=%@ :fileRef=%@:timestamp=%lu :char-range=%@ :line-range=%@ :<range-type-%lu>=%@ :name='%@' :name=%@:path='%@' :name='%@' :name='%@':buildSettings(%lu)=%@ :path='%@' :quote :identifier :rfc1034identifier :dir :abs :remoteRef='%@' :File='%@':Head Revision=%@:Active Branch=%@ :scmProprties='%@':sandboxEntry='%@' .... SNIP .... upper environment diagnostics type category description path kind message ranges alternate start edges location file 

Found also: DevToolsCore Framework Reference . Similar to API for Framework ( - (id)initWithName:(id)arg1 productTypeIdentifier:(id)arg2 ).

Could not find any other documentation for it, just this SO question ( xcode-info-plist-build-variable-product-namerfc1034identifier-seems-complete ).

+8
source

Since they are not documented, I do not think they have a name. When creating Xcode 4 templates, I found 3 variable modifiers in Apple templates that seem to do the following:

  • identifier : guarantees that it is a legal variable name C. It replaces illegal characters with underscores.
  • bundleIdentifier : ensures that this is a legal binding identifier.
  • RFC1034Identifier : ensures that it is a legal domain name.

And thanks to you, I know one more thing:

  • upper : change the value to upper case.

Xcode project templates are not documented. They are defined in plists with an inheritance system. Their elements have a specific structure and use several double underscore extension macros of type __PACKAGENAME__ (also see in Xcode 3), which are modified by one of the modifiers mentioned above.

If you want to dig further, I recommend Documentation: Xcode 4 templates . Learning the Apple templating system was painful and slow until I came across this PDF file. It is $ 10 / € 7.50, but worthy. Writing templates remains very cumbersome, I think Apple engineers use an internal tool or a lot of patience.

Assembly parameters are called β€œbuild settings" and are documented in the Xcode Configuration Reference . The default product name matches your target name, but you can make your own value if you want. These settings are specified when writing scripts. Usually you do not need to touch anything when using Xcode.

+4
source

Source: https://habr.com/ru/post/899624/


All Articles