| 190 | } |
| 191 | |
| 192 | bool iOSPlatformTools::OnPostProcess(CookingData& data) |
| 193 | { |
| 194 | const auto gameSettings = GameSettings::Get(); |
| 195 | const auto platformSettings = iOSPlatformSettings::Get(); |
| 196 | const auto platformDataPath = data.GetPlatformBinariesRoot(); |
| 197 | const auto projectVersion = Editor::Project->Version.ToString(); |
| 198 | const auto appName = GetAppName(); |
| 199 | |
| 200 | // Setup package name (eg. com.company.project) |
| 201 | String appIdentifier = platformSettings->AppIdentifier; |
| 202 | if (EditorUtilities::FormatAppPackageName(appIdentifier)) |
| 203 | return true; |
| 204 | |
| 205 | // Copy fresh XCode project template |
| 206 | if (FileSystem::CopyDirectory(data.OriginalOutputPath, platformDataPath / TEXT("Project"))) |
| 207 | { |
| 208 | LOG(Error, "Failed to deploy XCode project to {0} from {1}", data.OriginalOutputPath, platformDataPath); |
| 209 | return true; |
| 210 | } |
| 211 | |
| 212 | // Fix MoltenVK lib (copied from VulkanSDK xcframework) |
| 213 | FileSystem::MoveFile(data.DataOutputPath / TEXT("libMoltenVK.dylib"), data.DataOutputPath / TEXT("MoltenVK"), true); |
| 214 | { |
| 215 | // Fix rpath to point into dynamic library (rather than framework location) |
| 216 | CreateProcessSettings procSettings; |
| 217 | procSettings.HiddenWindow = true; |
| 218 | procSettings.WorkingDirectory = data.DataOutputPath; |
| 219 | procSettings.FileName = TEXT("/usr/bin/install_name_tool"); |
| 220 | procSettings.Arguments = TEXT("-id \"@rpath/libMoltenVK.dylib\" libMoltenVK.dylib"); |
| 221 | Platform::CreateProcess(procSettings); |
| 222 | } |
| 223 | |
| 224 | // Format project template files |
| 225 | Dictionary<String, String> configReplaceMap; |
| 226 | configReplaceMap[TEXT("${AppName}")] = appName; |
| 227 | configReplaceMap[TEXT("${AppIdentifier}")] = appIdentifier; |
| 228 | configReplaceMap[TEXT("${AppTeamId}")] = platformSettings->AppTeamId; |
| 229 | configReplaceMap[TEXT("${AppVersion}")] = platformSettings->AppVersion; |
| 230 | configReplaceMap[TEXT("${ProjectName}")] = gameSettings->ProductName; |
| 231 | configReplaceMap[TEXT("${ProjectVersion}")] = projectVersion; |
| 232 | configReplaceMap[TEXT("${HeaderSearchPaths}")] = Globals::StartupFolder; |
| 233 | configReplaceMap[TEXT("${ExportMethod}")] = GetExportMethod(platformSettings->ExportMethod); |
| 234 | configReplaceMap[TEXT("${UISupportedInterfaceOrientations_iPhone}")] = GetUIInterfaceOrientation(platformSettings->SupportedInterfaceOrientationsiPhone); |
| 235 | configReplaceMap[TEXT("${UISupportedInterfaceOrientations_iPad}")] = GetUIInterfaceOrientation(platformSettings->SupportedInterfaceOrientationsiPad); |
| 236 | { |
| 237 | // Initialize auto-generated areas as empty |
| 238 | configReplaceMap[TEXT("${PBXBuildFile}")] = String::Empty; |
| 239 | configReplaceMap[TEXT("${PBXCopyFilesBuildPhaseFiles}")] = String::Empty; |
| 240 | configReplaceMap[TEXT("${PBXFileReference}")] = String::Empty; |
| 241 | configReplaceMap[TEXT("${PBXFrameworksBuildPhase}")] = String::Empty; |
| 242 | configReplaceMap[TEXT("${PBXFrameworksGroup}")] = String::Empty; |
| 243 | configReplaceMap[TEXT("${PBXFilesGroup}")] = String::Empty; |
| 244 | configReplaceMap[TEXT("${PBXResourcesGroup}")] = String::Empty; |
| 245 | } |
| 246 | { |
| 247 | // Rename dotnet license files to not mislead the actual game licensing |
| 248 | FileSystem::MoveFile(data.DataOutputPath / TEXT("Dotnet/DOTNET-LICENSE.TXT"), data.DataOutputPath / TEXT("Dotnet/LICENSE.TXT"), true); |
| 249 | FileSystem::MoveFile(data.DataOutputPath / TEXT("Dotnet/DOTNET-THIRD-PARTY-NOTICES.TXT"), data.DataOutputPath / TEXT("Dotnet/THIRD-PARTY-NOTICES.TXT"), true); |
nothing calls this directly
no test coverage detected