Created IncludeVortexDeployment Compilation Step

This commit is contained in:
erri120 2019-11-04 13:47:41 +01:00 committed by Timothy Baldridge
parent 8d650fcbd9
commit bd3d753138
3 changed files with 43 additions and 3 deletions

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Wabbajack.Lib.CompilationSteps
{
public class IncludeVortexDeployment : ACompilationStep
{
public IncludeVortexDeployment(ACompiler compiler) : base(compiler)
{
}
public override Directive Run(RawSourceFile source)
{
if (!source.Path.EndsWith("\\vortex.deployment.msgpack") &&
!source.Path.EndsWith("\\vortex.deployment.json")) return null;
var inline = source.EvolveTo<InlineFile>();
inline.SourceDataID = _compiler.IncludeFile(File.ReadAllBytes(source.AbsolutePath));
return inline;
}
public override IState GetState()
{
return new State();
}
public class State : IState
{
public ICompilationStep CreateStep(ACompiler compiler)
{
return new IncludeVortexDeployment(compiler);
}
}
}
}

View File

@ -290,15 +290,16 @@ namespace Wabbajack.Lib
return new List<ICompilationStep>
{
//new IncludePropertyFiles(this),
new IgnoreGameFiles(this),
new IncludeRegex(this, @".*\.zip?$"),
//new IncludeRegex(this, "^.*\\.zip"),
new IncludeVortexDeployment(this),
//new IncludeRegex(this, "*.zip"),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Data")),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Papyrus Compiler")),
//new IgnoreStartsWith(this, Path.Combine(Consts.GameFolderFilesDir, "Skyrim")),
//new IgnoreRegex(this, Consts.GameFolderFilesDir + "\\\\.*\\.bsa"),
new IgnoreGameFiles(this),
new DirectMatch(this),
new IgnoreGameFiles(this),

View File

@ -102,6 +102,7 @@
<Compile Include="CompilationSteps\IncludeStubbedConfigFiles.cs" />
<Compile Include="CompilationSteps\IncludeTaggedMods.cs" />
<Compile Include="CompilationSteps\IncludeThisProfile.cs" />
<Compile Include="CompilationSteps\IncludeVortexDeployment.cs" />
<Compile Include="CompilationSteps\IStackStep.cs" />
<Compile Include="CompilationSteps\PatchStockESMs.cs" />
<Compile Include="CompilationSteps\Serialization.cs" />