2019-11-04 12:47:41 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2019-11-04 15:12:28 +00:00
|
|
|
|
using Wabbajack.Common;
|
2019-11-04 12:47:41 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Lib.CompilationSteps
|
|
|
|
|
{
|
|
|
|
|
public class IncludeVortexDeployment : ACompilationStep
|
|
|
|
|
{
|
|
|
|
|
public IncludeVortexDeployment(ACompiler compiler) : base(compiler)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override Directive Run(RawSourceFile source)
|
|
|
|
|
{
|
2019-11-04 15:12:28 +00:00
|
|
|
|
if (!source.Path.EndsWith("vortex.deployment.msgpack") &&
|
2019-11-04 12:47:41 +00:00
|
|
|
|
!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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|