MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnPostProcess

Method OnPostProcess

Source/Editor/Cooker/Platform/iOS/iOSPlatformTools.cpp:192–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192bool 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);

Callers

nothing calls this directly

Calls 11

GetExportMethodFunction · 0.85
LeftMethod · 0.80
GetAppNameFunction · 0.70
GetFunction · 0.50
NewFunction · 0.50
FormatFunction · 0.50
ToStringMethod · 0.45
EndsWithMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected