mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Don't rebuild BSAs that haven't changed
This commit is contained in:
parent
3303109704
commit
043324dfb7
@ -372,6 +372,40 @@ namespace Wabbajack.Lib
|
||||
|
||||
var indexed = ModList.Directives.ToDictionary(d => d.To);
|
||||
|
||||
var bsasToBuild = await ModList.Directives
|
||||
.OfType<CreateBSA>()
|
||||
.PMap(Queue, UpdateTracker, async b =>
|
||||
{
|
||||
var file = OutputFolder.Combine(b.To);
|
||||
if (!file.Exists)
|
||||
return (true, b);
|
||||
return (b.Hash != await file.FileHashCachedAsync(), b);
|
||||
});
|
||||
|
||||
var bsaIDsToRemove = bsasToBuild
|
||||
.Where(b => b.Item1 == false).Select(t => t.b.TempID).ToHashSet();
|
||||
|
||||
var bsaPathsToNotBuild = bsasToBuild
|
||||
.Where(b => b.Item1 == false).Select(t => t.b.To.RelativeTo(OutputFolder))
|
||||
.ToHashSet();
|
||||
|
||||
indexed = indexed.Values
|
||||
.Where(d =>
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case CreateBSA bsa:
|
||||
return !bsaIDsToRemove.Contains(bsa.TempID);
|
||||
case FromArchive a when a.To.StartsWith($"{Consts.BSACreationDir}"):
|
||||
{
|
||||
return !bsaIDsToRemove.Any(b =>
|
||||
a.To.RelativeTo(OutputFolder).InFolder(OutputFolder.Combine(Consts.BSACreationDir, b)));
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}).ToDictionary(d => d.To);
|
||||
|
||||
|
||||
var profileFolder = OutputFolder.Combine("profiles");
|
||||
var savePath = (RelativePath)"saves";
|
||||
@ -388,6 +422,9 @@ namespace Wabbajack.Lib
|
||||
|
||||
if (NoDeleteRegex.IsMatch(f.ToString()))
|
||||
return;
|
||||
|
||||
if (bsaPathsToNotBuild.Contains(f))
|
||||
return;
|
||||
|
||||
Utils.Log($"Deleting {relativeTo} it's not part of this ModList");
|
||||
await f.DeleteAsync();
|
||||
|
@ -345,6 +345,8 @@ namespace Wabbajack.Lib
|
||||
streams.Do(s => s.Dispose());
|
||||
|
||||
await sourceDir.DeleteDirectory();
|
||||
// Write the expected hash so we ignore compression changes
|
||||
OutputFolder.Combine(bsa.To).FileHashWriteCache(bsa.Hash);
|
||||
|
||||
if (UseCompression)
|
||||
await OutputFolder.Combine(bsa.To).Compact(FileCompaction.Algorithm.XPRESS16K);
|
||||
|
@ -6,4 +6,7 @@ dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --runtime win
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com M:\Games\wabbajack_files\launcher\Wabbajack.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com M:\Games\wabbajack_files\app\Wabbajack.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com M:\Games\wabbajack_files\app\wabbajack-cli.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com M:\Games\wabbajack_files\cli\wabbajack-cli.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com M:\Games\wabbajack_files\cli\wabbajack-cli.exe
|
||||
"c:\Program Files\7-Zip\7z.exe" a m:\Games\wabbajack_files\app.zip m:\Games\wabbajack_files\app\*
|
||||
"c:\Program Files\7-Zip\7z.exe" a m:\Games\wabbajack_files\cli-3.0.zip m:\Games\wabbajack_files\cli\*
|
||||
copy m:\Games\wabbajack_files\launcher\Wabbajack.exe m:\Games\wabbajack_files\Wabbajack.exe
|
Loading…
Reference in New Issue
Block a user