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
|
@ -863,17 +863,6 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fileType.empty())
|
if(fileType.empty())
|
||||||
{
|
|
||||||
// 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";
|
|
||||||
useLastKnownFileType = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Compute the extension without leading '.'.
|
// Compute the extension without leading '.'.
|
||||||
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
|
std::string ext = cmSystemTools::GetFilenameLastExtension(fullpath);
|
||||||
|
@ -882,6 +871,17 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
|
||||||
ext = ext.substr(1);
|
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 = (ext == "xcassets"? "folder.assetcatalog" : "folder");
|
||||||
|
useLastKnownFileType = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
fileType = GetSourcecodeValueFromFileExtension(
|
fileType = GetSourcecodeValueFromFileExtension(
|
||||||
ext, lang, useLastKnownFileType);
|
ext, lang, useLastKnownFileType);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue