Merge topic 'xcode-assetcatalog-folder-type'
8eacc339
Xcode: Reference '.xcassets' folders as assetcatalog (#15125)02aa5965
Xcode: Refactor internal file type extension extraction
This commit is contained in:
commit
1dbb46483a
|
@ -864,24 +864,24 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
|
|||
}
|
||||
if(fileType.empty())
|
||||
{
|
||||
// Compute the extension without leading '.'.
|
||||
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
|
||||
if(!ext.empty())
|
||||
{
|
||||
ext = ext.substr(1);
|
||||
}
|
||||
|
||||
// If fullpath references a directory, then we need to specify
|
||||
// lastKnownFileType as folder in order for Xcode to be able to
|
||||
// open the contents of the folder.
|
||||
// (Xcode 4.6 does not like explicitFileType=folder).
|
||||
if(cmSystemTools::FileIsDirectory(fullpath.c_str()))
|
||||
{
|
||||
fileType = "folder";
|
||||
fileType = (ext == "xcassets"? "folder.assetcatalog" : "folder");
|
||||
useLastKnownFileType = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Compute the extension without leading '.'.
|
||||
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
|
||||
if(!ext.empty())
|
||||
{
|
||||
ext = ext.substr(1);
|
||||
}
|
||||
|
||||
fileType = GetSourcecodeValueFromFileExtension(
|
||||
ext, lang, useLastKnownFileType);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue