Mirror every non-.lasset /Game/ file under /Game/ for loose-files mode.
| 51 | const FLooseRoot Roots[] = { { "/Game", "Game" } }; |
| 52 | |
| 53 | for (const FLooseRoot& Root : Roots) |
| 54 | { |
| 55 | const FFixedString DstRoot = Paths::Combine(OutDir, Root.Top); |
| 56 | Filesystem::MakeDirectoryTree(DstRoot); |
| 57 | |
| 58 | const FString Alias(Root.Alias); |
| 59 | const FString Prefix = Alias + "/"; |
| 60 | |
| 61 | VFS::RecursiveDirectoryIterator(FStringView(*Alias, Alias.Len()), [&](const VFS::FFileInfo& Info) |
| 62 | { |
| 63 | if (Info.IsDirectory()) |
| 64 | { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | FStringView Vp(*Info.VirtualPath, Info.VirtualPath.Len()); |
| 69 | if (EndsWithIgnoreCase(Vp, ".lasset") || IsDevelopmentOnlyGameFile(Vp, true)) |
| 70 | { |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | if (Vp.Len() <= Prefix.Len()) |
| 75 | { |
| 76 | return; |
| 77 | } |
| 78 | FStringView Relative = Vp.Mid(Prefix.Len()); |
| 79 | |
| 80 | TVector<uint8> Bytes; |
| 81 | if (!VFS::ReadFile(Bytes, Info.VirtualPath)) |
| 82 | { |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | const FFixedString Dst = Paths::Combine(DstRoot, Relative); |
| 87 | if (!Filesystem::WriteFile(Dst, TSpan<const uint8>(Bytes.GetData(), Bytes.Num()))) |
| 88 | { |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | ++Count; |
| 93 | LogPackager(LogFunc, *Format(" + {}/{}", Root.Top, Relative)); |
| 94 | }); |
| 95 | } |
| 96 | return Count; |
| 97 | } |
| 98 | |
| 99 | FStringView WithoutLibraryPrefix(const FPackagePlatformRules& Rules, FStringView FileName) |
| 100 | { |
| 101 | const bool bPrefixed = !Rules.LibraryPrefix.IsEmpty() && FileName.StartsWith(Rules.LibraryPrefix); |
| 102 | return bPrefixed ? FileName.Mid(IntCastChecked<int32>(Rules.LibraryPrefix.Len())) : FileName; |
| 103 | } |
| 104 | |
| 105 | // The tail every binary of this package ends in, "Development" for a game and "Server-Development" for a server. |
| 106 | FString BinaryTail(const FString& Config, bool bServer) |
| 107 | { |
| 108 | return bServer ? FString("Server-") + Config : Config; |
| 109 | } |
| 110 |
no test coverage detected