On Mar 18, 2009, at 3:05 AM, Andreas Grosam wrote: Where does Xcode searches for the Info.plist file?
I created a folder "Resources" as a sub folder in the project directory and moved the Info.plist file into it. Furthermore, in the project view I created a new Group named accordingly and specified its path, which uses "Relative to enclosing group". Then I put the Info.plist file into that Group and specified "Relative to enclosing group". Within Xcode IDE, Xcode can locate the Info.plist file.
When I click "Info" for the Info.plist file it shows me that "path" is "Info.plist", and "full path" shows "<pathtoproject>/Resources/Info.plist" Which seems correct to me, since the path of its enclosing Group "Resources" is specified and points to the folder "<pathToProject>/Resources".
Now, when compiling, the Xcode tool "< com.apple.tools.info-plist-utility >" is unable to find the Info.plist file:
Processing <pathToProject>/Info.plist Info.plist mkdir <pathToProject>/build/Debug-iphonesimulator/Test.app cd <pathToProject> setenv PATH "<apath>:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" <com.apple.tools.info-plist-utility> Info.plist -genpkginfo <pathToProject>/build/Debug-iphonesimulator/Test.app/PkgInfo -expandbuildsettings -o <pathToProject>/build/Debug-iphonesimulator/Test.app/Info.plist error: The file “Info.plist” does not exist.
I expected, that Xcode would find the Info.plist file. Unfortunately, that seems not to work. Setting the path mode to "Project relative" for the Info.plist file does not help either. As far as I can see, there is also no method to specify a path for the plist file. It seems, Xcode always expects the Info.plist to be located in the project folder. Do I miss something?
Funny, that it works with other resources (although the transcript makes me a bit uncertain): the Localisable.strings file is exactly specified as the Info.plist file, and it resides in the same folder <pathtoproject>/Resources:
CopyStringsFile <pathToProject>/build/Debug-iphonesimulator/Test.app/Localizable.strings Resources/Localizable.strings cd <pathToProject> setenv ICONV /usr/bin/iconv setenv PATH "<apath>:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings --validate --inputencoding UTF-16 --outputencoding UTF-16 Resources/Localizable.strings --outdir <pathToProject>/build/Debug-iphonesimulator/Test.app
How can I Xcode convince to use the specified path to the Info.plist file? Is there any pitfall in what I'm trying to accomplish? Thanks for help.
The Info.plist file (along with the Exported Symbols, Nonexported Symbols, and Prefix file) are not found according to their target membership or the settings in their File Reference that you get via Get Info. You provide the appropriate path to them in the target's Build Settings. This allows you, for example, to have different Info.plist files for different configurations.
The value of the Info.plist File build setting is presumed to be a path relative to the project root, but you can use other build settings to set it to anything you like. If the Info.plist is in the Resources folder, set the value of the build setting to Resources/Info.plist (or, if you want to be pedantic, $(SRCROOT)/Resources/Info.plist )
Also make sure that the Info.plist file is not included in the Copy Bundle Resources phase. It's processes separately from other resources, and if you include it there, you'll get a conflict.
Chris
|