views:

227

answers:

1

I have defined my own environment variable (VERSION) in a .xcconfig file and based my configurations on that as described at http://www.silverchairsolutions.com/blog/2008/03/automating-cocoa-deployments-with-sparkle-and-xcode. My environment variable is indeed expanded in Info.plist but not in my Settings.bundle/Root.plist. PRODUCT_NAME is expanded as it should. If I replace VERSION with PRODUCT_NAME, it is not expanded. Why won't it expand there?

Root.plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
<plist version="1.0">
<dict>
<key>Title</key>
<string>${PRODUCT_NAME}</string>
<key>PreferenceSpecifiers</key>
<array>
    <dict>
        <key>DefaultValue</key>
        <string>${VERSION}</string>
        <key>Key</key>
        <string>version</string>
        <key>Title</key>
        <string>Version</string>
        <key>Type</key>
        <string>PSTitleValueSpecifier</string>
    </dict>
</array>

A: 

We've resolved this by using our own setting, APP_PRODUCT_NAME, in our .xcconfig and then referencing that in the build configuration as PRODUCT_NAME = $APP_PRODUCT_NAME. This seems to expand fine in the bundle by using Bundle Name = ${APP_PRODUCT_NAME} in the plist.

Dave Shanley