| 13 | #include "Editor/Utilities/EditorUtilities.h" |
| 14 | |
| 15 | bool DeployDataStep::Perform(CookingData& data) |
| 16 | { |
| 17 | data.StepProgress(TEXT("Deploying engine data"), 0); |
| 18 | const String depsRoot = data.GetPlatformBinariesRoot(); |
| 19 | const auto& gameSettings = *GameSettings::Get(); |
| 20 | const auto& buildSettings = *BuildSettings::Get(); |
| 21 | |
| 22 | // Setup output folders and copy required data |
| 23 | const auto contentDir = data.DataOutputPath / TEXT("Content"); |
| 24 | if (FileSystem::DirectoryExists(contentDir)) |
| 25 | { |
| 26 | // Remove old content files |
| 27 | FileSystem::DeleteDirectory(contentDir, true); |
| 28 | |
| 29 | // Give some time for Explorer (if location was viewed) |
| 30 | Platform::Sleep(10); |
| 31 | } |
| 32 | FileSystem::CreateDirectory(contentDir); |
| 33 | const String dstMono = data.DataOutputPath / TEXT("Mono"); |
| 34 | #if USE_NETCORE |
| 35 | { |
| 36 | // Remove old Mono files |
| 37 | FileSystem::DeleteDirectory(dstMono); |
| 38 | FileSystem::DeleteFile(data.DataOutputPath / TEXT("MonoPosixHelper.dll")); |
| 39 | } |
| 40 | String dstDotnet = data.DataOutputPath / TEXT("Dotnet"); |
| 41 | const DotNetAOTModes aotMode = data.Tools->UseAOT(); |
| 42 | const bool usAOT = aotMode != DotNetAOTModes::None && aotMode != DotNetAOTModes::NoDotnet; |
| 43 | if (usAOT) |
| 44 | { |
| 45 | // Deploy Dotnet files into intermediate cooking directory for AOT |
| 46 | FileSystem::DeleteDirectory(dstDotnet); |
| 47 | dstDotnet = data.ManagedCodeOutputPath; |
| 48 | } |
| 49 | if (aotMode == DotNetAOTModes::NoDotnet) |
| 50 | { |
| 51 | // No .NET |
| 52 | FileSystem::DeleteDirectory(dstDotnet); |
| 53 | } |
| 54 | else if (buildSettings.SkipDotnetPackaging && data.Tools->UseSystemDotnet()) |
| 55 | { |
| 56 | // Use system-installed .NET Runtime |
| 57 | FileSystem::DeleteDirectory(dstDotnet); |
| 58 | LOG(Info, "Not using .NET Runtime"); |
| 59 | } |
| 60 | else |
| 61 | { |
| 62 | // Deploy .NET Runtime files |
| 63 | FileSystem::CreateDirectory(dstDotnet); |
| 64 | String srcDotnet = depsRoot / TEXT("Dotnet"); |
| 65 | if (FileSystem::DirectoryExists(srcDotnet)) |
| 66 | { |
| 67 | // Use prebuilt .NET installation for that platform |
| 68 | LOG(Info, "Using .NET Runtime {} at {}", data.Tools->GetName(), srcDotnet); |
| 69 | if (EditorUtilities::CopyDirectoryIfNewer(dstDotnet, srcDotnet, true)) |
| 70 | { |
| 71 | data.Error(TEXT("Failed to copy .NET runtime data files.")); |
| 72 | return true; |
nothing calls this directly
no test coverage detected