staticpublicvoidRepackageIPAFromStub() { // ... string SourceDir = Path.GetFullPath(ZipSourceDir); string[] PayloadFiles = Directory.GetFiles(SourceDir, "*.*", Config.bIterate ? SearchOption.TopDirectoryOnly : SearchOption.AllDirectories); foreach (string Filename in PayloadFiles) { if (!IpaPakFileFilter.Matches(Filename)) { Program.Log("IpaPakFileFilter not match file {0}", Filename); continue; } // Program.Log("IpaPakFileFilter match file {0}", Filename); } //... }
这样再执行打包IOS,就会按照指定的过滤规则来添加文件了,实现了与Android上一致的行为。
打包过程中的Log如下(上文代码已注释):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Saving IPA ... ProjectDir path C:\BuildAgent\workspace\PackageWindows\Client EngineIni path C:\BuildAgent\workspace\PackageWindows\Client\Config\DefaultEngine.ini RawPakFilterRules -*.pak,pakchunk0-* PakRules -*.pak PakRules pakchunk0-* IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\Assets.car IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\Info.plist IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\LaunchScreenIOS.webp IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\Manifest_DebugFiles_IOS.txt IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\Manifest_NonUFSFiles_IOS.txt IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\mute.caf IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\ue4commandline.txt IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\cookeddata\fgame\content\movies\logo.mp4 IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\cookeddata\fgame\content\movies\sparkmore.mp4 IpaPakFileFilter match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\cookeddata\fgame\content\paks\pakchunk0-ios.pak IpaPakFileFilter not match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\cookeddata\fgame\content\paks\pakchunk1-ios.pak IpaPakFileFilter not match file C:\BuildAgent\workspace\PackageWindows\Client\Saved\StagedBuilds\IOS\cookeddata\fgame\content\paks\pakchunk2-ios.pak ...
if (bRecurseToParents) { const TArray<FPrimaryAssetId> *ManagementParents = ManagementParentMap.Find(PrimaryAssetId);
if (ManagementParents) { for (const FPrimaryAssetId& Manager : *ManagementParents) { if (!ManagerSet.Contains(Manager)) { // Add to end of list, this will recurse again if needed ReferencingPrimaryAssets.Add(Manager); } } } } } } return bFoundAny; }