JD2022-TU1/main/tools/apps/Packager/Tasks/GenDependenciesTask.cs

36 lines
1.1 KiB
C#

using System;
using System.ComponentModel;
using System.IO;
using Packager.Parameters;
namespace Packager.Tasks
{
[DisplayName("Generate Dependencies")]
public class GenDependenciesTask: AssetCookerTask
{
[Input(nameof(RootFilePaths), IOCardinality.Multi, IOType.File)]
public ReferenceList RootFilePaths { get; set; }
[Output(nameof(DependenciesFilePaths), IOType.File)]
public ReferenceList DependenciesFilePaths = new ReferenceList();
public GenDependenciesTask()
{
ComputeDependencies = true;
RootFilePaths = new ReferenceList();
}
protected override void StartInternal(BuildConfiguration profile, cookerWrapper cooker)
{
MergeList = CreateProxyFile(RootFilePaths);
OutputDependenciesFolder = TaskOutputFolder;
foreach (var inputName in RootFilePaths)
{
DependenciesFilePaths.Add(Path.Combine(TaskOutputFolder, Path.GetFileNameWithoutExtension(inputName) + ".txt"));
}
Start(profile);
}
}
}