diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..3fd23a06 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "xml.format.maxLineWidth": 0 +} \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/ReadMe.md b/sdk/Shimakaze.Sdk.RA2/ReadMe.md index d6dec019..fa8184cd 100644 --- a/sdk/Shimakaze.Sdk.RA2/ReadMe.md +++ b/sdk/Shimakaze.Sdk.RA2/ReadMe.md @@ -2,3 +2,130 @@ 适用于RA2的MSBuild Sdk +## 属性 +|属性名|作用| +|:-:|:-| +|ShimakazeSdkPath|指定Shimakaze.Sdk的位置| +|UseDefaultItems|是否使用默认的Items| +|Configuration|使用的配置,通常是`Debug`或`Release`| +|Platform|目标平台,通常是`Vanilla`| +|BaseIntermediateOutputPath|`obj`| +|IntermediateOutputPath|`$(BaseIntermediateOutputPath)\$(Configuration)`| +|BaseOutputPath|`bin`| +|OutputPath|`$(BaseOutputPath)\$(Configuration)`| +|ShimakazeSdkExclude|默认被排除的文件 `$(BaseOutputPath)\**\*;$(BaseIntermediateOutputPath)\**\*`| + +## 项 +- `IniFile` 表示一个将要被处理的INI文件 + - `Ignore` 表示这个文件不需要被处理 + - `TargetFile` 表示最终合并后的文件 + - `Intermediate` 表示文件中间产物的位置 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 +- `IntermediateIniFile` 表示Ini文件的中间产物 + - `TargetFile` 表示最终合并后的文件 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 +- `FinalIniFile` 最终合并后的Ini文件 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 +- `CsfFile` 表示一个将要被处理的CSF文件 + - `Ignore` 表示这个文件不需要被处理 + - `TargetFile` 表示最终合并后的文件 + - `Intermediate` 表示文件中间产物的位置 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 + - `Type` 表示文件的类型 +- `IntermediateCsfFile` 表示Csf文件的中间产物 + - `TargetFile` 表示最终合并后的文件 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 +- `FinalCsfFile` 最终合并后的Csf文件 + - `Pack` 表示文件会被打包到Mix文件中 + - `TargetPack` 表示文件会被打包到这个Mix文件中 +- `MixAssetsFile` 一定会被打包的文件 + - `TargetPack` 表示文件会被打包到这个Mix文件中 + +## 任务 +|任务名|描述| +|:-:|:-| +|TaskCsfGenerator|CSF生成器 +|TaskCsfMerger|CSF合并器 +|TaskIniMerger|INI合并器 +|TaskIniPreprocessor|INI预处理器 +|TaskMixGenerator|MIX生成器 + +## 目标 + +- CoreCompile +- CoreMerger +- Build +- Pack +- Clean + +- PreIniPreprocessor +- IniPreprocessor +- PostIniPreprocessor + +- PreIniMerger +- IniMerger +- PostIniMerger + +- PreCsfGenerator +- CsfGenerator +- PostCsfGenerator + +- PreCsfMerger +- CsfMerger +- PostCsfMerger + +- PreMixGenerator +- MixGenerator +- PostMixGenerator + +## 任务顺序 +```mermaid +graph TB; + subgraph Target:IniPreprocessor; + PreIniPreprocessor-->IniPreprocessor-->PostIniPreprocessor; + end; + subgraph Target:IniMerger; + PreIniMerger-->IniMerger-->PostIniMerger; + end; + subgraph Target:CsfGenerator; + PreCsfGenerator-->CsfGenerator-->PostCsfGenerator; + end; + subgraph Target:CsfMerger; + PreCsfMerger-->CsfMerger-->PostCsfMerger; + end; + subgraph Target:MixGenerator; + PreMixGenerator-->MixGenerator-->PostMixGenerator; + end; + subgraph Target:Pack; + Target:MixGenerator; + end; + subgraph Target:CoreCompile; + Target:IniPreprocessor-->Target:CsfGenerator; + end; + subgraph Target:CoreMerger; + Target:IniMerger-->Target:CsfMerger; + end; + subgraph Target:Build; + Target:CoreCompile-->Target:CoreMerger; + end; + subgraph Target:Clean; + RemoveDir:OutputPath/IntermediateOutputPath + end; + subgraph Target:ReBuild; + Target:Clean-->Target:Build; + end; + + Target:Build-->Target:Pack; + + Target:Clean; +``` + +## 默认 Defines +通常情况下,我们会默认定义以下Define: +- 完全大写的 Configuration 如 `DEBUG` 或 `RELEASE` +- 完全大写的 Platform 如 `VANILLA` \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.props b/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.props index 4a09681c..085dfe57 100644 --- a/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.props +++ b/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.props @@ -1,50 +1,43 @@ - + - $(MSBuildThisFileDirectory).. + $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)..")) + + True Debug Vanilla $(Configuration.ToUpper());$(Platform.ToUpper());$(Defines) obj - $(MSBuildProjectDirectory)\$(BaseIntermediateOutputPath)\$(Configuration) + $(BaseIntermediateOutputPath)\$(Configuration) bin - $(MSBuildProjectDirectory)\$(BaseOutputPath)\$(Configuration) + $(BaseOutputPath)\$(Configuration) - ra2md.csf - rulesmd.ini - artmd.ini - expandmd01.mix + $(BaseOutputPath)\**\*;$(BaseIntermediateOutputPath)\**\* - - - - - - - - - - - - - - - - + + + + + - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.targets b/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.targets index 4e1890e0..68eb1764 100644 --- a/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.targets +++ b/sdk/Shimakaze.Sdk.RA2/Sdk/Sdk.targets @@ -1,25 +1,46 @@ - + + + - - + + + + + + + - + + - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/Sdk/tasks.props b/sdk/Shimakaze.Sdk.RA2/Sdk/tasks.props new file mode 100644 index 00000000..99bcc703 --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/Sdk/tasks.props @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Csf.targets b/sdk/Shimakaze.Sdk.RA2/targets/Csf.targets index 8199170e..831e3958 100644 --- a/sdk/Shimakaze.Sdk.RA2/targets/Csf.targets +++ b/sdk/Shimakaze.Sdk.RA2/targets/Csf.targets @@ -1,42 +1,7 @@ - - - <_CsfFile - Include="@(CsfFile)" - Destination="$(IntermediateOutputPath)\%(RecursiveDir)%(Filename).g%(Extension).csf" - Merge="True" /> - <_CsfFile Remove="@(CsfFile -> WithMetadataValue('SkipBuild', 'True'))" /> - - - + + - - - - - - <_CsfFile Remove="@(_CsfFile)" /> - - - - - - - - - - <_CsfFile Remove="@(_CsfFile)" /> - - \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfGenerator.targets b/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfGenerator.targets new file mode 100644 index 00000000..fefc4ab7 --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfGenerator.targets @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfMerger.targets b/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfMerger.targets new file mode 100644 index 00000000..a30f2b3d --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/targets/Csf/CsfMerger.targets @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Ini.targets b/sdk/Shimakaze.Sdk.RA2/targets/Ini.targets index 20993d95..1e15494f 100644 --- a/sdk/Shimakaze.Sdk.RA2/targets/Ini.targets +++ b/sdk/Shimakaze.Sdk.RA2/targets/Ini.targets @@ -1,59 +1,7 @@ - - - - - <_IniFile - Include="@(IniFile)" - Destination="$(IntermediateOutputPath)\%(RecursiveDir)%(Filename).g.pp%(Extension)" - Merge="True" /> - <_IniFile Remove="@(IniFile -> WithMetadataValue('SkipPreprocess', 'True'))" /> - - - - - - - - - - - - - - - <__IniType Include="@(IniFile -> Metadata('Type'))" KeepDuplicates="False" - KeepMetadata="False" /> - <_IniType Include="@(__IniType)" Destination="$(OutputPath)\$(%(Identity)sIniFileName)" /> - <__IniType Remove="@(__IniType)" /> - - - - - - - - - - <_IniType Remove="@(_IniType)" /> - - + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniMerger.targets b/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniMerger.targets new file mode 100644 index 00000000..5d8b9908 --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniMerger.targets @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniPreprocessor.targets b/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniPreprocessor.targets new file mode 100644 index 00000000..87a9311d --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/targets/Ini/IniPreprocessor.targets @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Mix.targets b/sdk/Shimakaze.Sdk.RA2/targets/Mix.targets index 7fe8959f..3dbf98b6 100644 --- a/sdk/Shimakaze.Sdk.RA2/targets/Mix.targets +++ b/sdk/Shimakaze.Sdk.RA2/targets/Mix.targets @@ -1,20 +1,6 @@ - - - - - - - - - - - - - + \ No newline at end of file diff --git a/sdk/Shimakaze.Sdk.RA2/targets/Mix/MixGenerator.targets b/sdk/Shimakaze.Sdk.RA2/targets/Mix/MixGenerator.targets new file mode 100644 index 00000000..e74c8ed4 --- /dev/null +++ b/sdk/Shimakaze.Sdk.RA2/targets/Mix/MixGenerator.targets @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Shimakaze.Sdk.Build/TaskCsfGenerator.cs b/src/Shimakaze.Sdk.Build/TaskCsfGenerator.cs index 2b5d3601..5cfa04f9 100644 --- a/src/Shimakaze.Sdk.Build/TaskCsfGenerator.cs +++ b/src/Shimakaze.Sdk.Build/TaskCsfGenerator.cs @@ -18,9 +18,9 @@ namespace Shimakaze.Sdk.Build; public sealed class TaskCsfGenerator : MSTask { /// - /// Destination + /// 生成的中间文件的路径 /// - public const string Metadata_Destination = "Destination"; + public const string Metadata_Intermediate = "Intermediate"; /// /// Type @@ -48,7 +48,7 @@ public override bool Execute() List items = new(SourceFiles.Length); foreach (var file in SourceFiles) { - var dest = file.GetMetadata(Metadata_Destination); + var dest = file.GetMetadata(Metadata_Intermediate); var tag = file.GetMetadata(Metadata_Type); if (!dest.CreateParentDirectory(Log)) return false; @@ -147,7 +147,7 @@ public override bool Execute() provider.GetRequiredService>().WriteAsync(csf).Wait(); TaskItem item = new(dest); file.CopyMetadataTo(item); - item.RemoveMetadata(Metadata_Destination); + item.RemoveMetadata(Metadata_Intermediate); item.SetMetadata(Metadata_Type, "Csf"); items.Add(item); } diff --git a/src/Shimakaze.Sdk.Build/TaskCsfMerger.cs b/src/Shimakaze.Sdk.Build/TaskCsfMerger.cs index 2aa86395..845c558f 100644 --- a/src/Shimakaze.Sdk.Build/TaskCsfMerger.cs +++ b/src/Shimakaze.Sdk.Build/TaskCsfMerger.cs @@ -12,7 +12,10 @@ namespace Shimakaze.Sdk.Build; /// public sealed class TaskCsfMerger : MSTask { - private const string Metadata_Pack = "Pack"; + /// + /// Pack + /// + public const string Metadata_Pack = "Pack"; /// /// 生成的文件 @@ -52,7 +55,8 @@ public override bool Execute() OutputFile.SetMetadata(Metadata_Pack, true.ToString()); using Stream output = File.Create(DestinationFile); merger.BuildAndWriteToAsync(output).Wait(); + output.Flush(); - return true; + return !Log.HasLoggedErrors; } } \ No newline at end of file diff --git a/src/Shimakaze.Sdk.Build/TaskIniMerger.cs b/src/Shimakaze.Sdk.Build/TaskIniMerger.cs index e4e39e24..ad68acf6 100644 --- a/src/Shimakaze.Sdk.Build/TaskIniMerger.cs +++ b/src/Shimakaze.Sdk.Build/TaskIniMerger.cs @@ -12,37 +12,22 @@ namespace Shimakaze.Sdk.Build; /// public sealed class TaskIniMerger : MSTask { - /// - /// Destination - /// - public const string Metadata_Destination = "Destination"; - - /// - /// Merge - /// - public const string Metadata_Merge = "Merge"; - /// /// Pack /// public const string Metadata_Pack = "Pack"; /// - /// Type - /// - public const string Metadata_Type = "Type"; - - /// - /// 生成的文件路径 + /// 生成的文件 /// [Required] - public required ITaskItem[] DestinationFiles { get; set; } + public required string DestinationFile { get; set; } /// /// 生成的目标文件 /// [Output] - public ITaskItem[] OutputFiles { get; set; } = Array.Empty(); + public ITaskItem? OutputFile { get; set; } /// /// 将要被处理的文件 @@ -54,35 +39,23 @@ public sealed class TaskIniMerger : MSTask public override bool Execute() { Log.LogMessage("Merging Ini..."); - var outputs = DestinationFiles - .DistinctBy(i => i.ItemSpec) - .ToDictionary(i => i.ItemSpec, i => i.GetMetadata(Metadata_Destination)) - .AsReadOnly(); + if (!DestinationFile.CreateParentDirectory(Log)) + return false; - IList list = new List(); - foreach (var group in SourceFiles.GroupBy(i => i.GetMetadata(Metadata_Type))) + IniMerger merger = new(); + OutputFile = new TaskItem(DestinationFile); + foreach (var file in SourceFiles) { - if (!outputs[group.Key].CreateParentDirectory(Log)) - continue; - - IO.Ini.IniMerger merger = new(); - TaskItem item = new(outputs[group.Key]); - foreach (var file in group) - { - using var stream = File.OpenRead(file.ItemSpec); - using IniReader deserializer = new(stream); - merger.UnionWith(deserializer.ReadAsync().Result); - file.CopyMetadataTo(item); - } - - item.SetMetadata(Metadata_Pack, true.ToString()); - item.RemoveMetadata(Metadata_Merge); - using Stream output = File.Create(outputs[group.Key]); - merger.BuildAndWriteToAsync(output).Wait(); - list.Add(item); + using Stream stream = File.OpenRead(file.ItemSpec); + using IniReader reader = new(stream); + merger.UnionWith(reader.ReadAsync().Result); + file.CopyMetadataTo(OutputFile); } - OutputFiles = list.ToArray(); + OutputFile.SetMetadata(Metadata_Pack, true.ToString()); + using Stream output = File.Create(DestinationFile); + merger.BuildAndWriteToAsync(output).Wait(); + output.Flush(); return !Log.HasLoggedErrors; } diff --git a/src/Shimakaze.Sdk.Build/TaskIniPreprocessor.cs b/src/Shimakaze.Sdk.Build/TaskIniPreprocessor.cs index 4af296c4..5975be0e 100644 --- a/src/Shimakaze.Sdk.Build/TaskIniPreprocessor.cs +++ b/src/Shimakaze.Sdk.Build/TaskIniPreprocessor.cs @@ -14,7 +14,10 @@ namespace Shimakaze.Sdk.Build; /// public sealed class TaskIniPreprocessor : MSTask { - private const string Metadata_Destination = "Destination"; + /// + /// 生成的中间文件的路径 + /// + public const string Metadata_Intermediate = "Intermediate"; /// /// 符号 @@ -48,7 +51,7 @@ public override bool Execute() foreach (var file in SourceFiles) { - var dest = file.GetMetadata(Metadata_Destination); + var dest = file.GetMetadata(Metadata_Intermediate); if (!dest.CreateParentDirectory(Log)) return false; @@ -59,7 +62,7 @@ public override bool Execute() TaskItem item = new(dest); file.CopyMetadataTo(item); - item.RemoveMetadata(Metadata_Destination); + item.RemoveMetadata(Metadata_Intermediate); provider.GetRequiredService>().Add(item); task.Wait(); diff --git a/src/Shimakaze.Sdk.Build/TaskMixGennerator.cs b/src/Shimakaze.Sdk.Build/TaskMixGenerator.cs similarity index 93% rename from src/Shimakaze.Sdk.Build/TaskMixGennerator.cs rename to src/Shimakaze.Sdk.Build/TaskMixGenerator.cs index eff73ccb..5ad89707 100644 --- a/src/Shimakaze.Sdk.Build/TaskMixGennerator.cs +++ b/src/Shimakaze.Sdk.Build/TaskMixGenerator.cs @@ -10,7 +10,7 @@ namespace Shimakaze.Sdk.Build; /// /// Mix Packer Task /// -public sealed class TaskMixGennerator : MSTask +public sealed class TaskMixGenerator : MSTask { /// /// 生成的文件 @@ -58,7 +58,8 @@ public override bool Execute() using var output = File.Create(DestinationFile); builder.BuildAsync(output).Wait(); + output.Flush(); - return true; + return !Log.HasLoggedErrors; } } \ No newline at end of file diff --git a/src/Shimakaze.Sdk/IO/Ini/IniMerger.cs b/src/Shimakaze.Sdk/IO/Ini/IniMerger.cs index fa032287..c4bd35ca 100644 --- a/src/Shimakaze.Sdk/IO/Ini/IniMerger.cs +++ b/src/Shimakaze.Sdk/IO/Ini/IniMerger.cs @@ -55,7 +55,7 @@ public virtual IniDocument Build() public virtual async Task BuildAndWriteToAsync(Stream stream, IProgress? progress = default, CancellationToken cancellationToken = default) { await using IniWriter serializer = new(stream, true); - await serializer.WriteAsync(new(_cache.Values), progress, cancellationToken); + await serializer.WriteAsync(Build(), progress, cancellationToken); } /// diff --git a/src/Shimakaze.Sdk/IO/Ini/IniWriter.cs b/src/Shimakaze.Sdk/IO/Ini/IniWriter.cs index 62a533f5..d3414143 100644 --- a/src/Shimakaze.Sdk/IO/Ini/IniWriter.cs +++ b/src/Shimakaze.Sdk/IO/Ini/IniWriter.cs @@ -48,8 +48,7 @@ protected override void Dispose(bool disposing) { if (disposing) { - if (!_leaveOpen) - BaseWriter.Dispose(); + BaseWriter.Dispose(); } base.Dispose(disposing); @@ -59,8 +58,7 @@ protected override void Dispose(bool disposing) [ExcludeFromCodeCoverage] protected override ValueTask DisposeAsyncCore() { - if (!_leaveOpen) - BaseWriter.Dispose(); + BaseWriter.Dispose(); return base.DisposeAsyncCore(); } diff --git a/test/Shimakaze.Sdk.Build.Tests/TaskCsfGeneratorTest.cs b/test/Shimakaze.Sdk.Build.Tests/TaskCsfGeneratorTest.cs index 6c22813c..2df84056 100644 --- a/test/Shimakaze.Sdk.Build.Tests/TaskCsfGeneratorTest.cs +++ b/test/Shimakaze.Sdk.Build.Tests/TaskCsfGeneratorTest.cs @@ -21,7 +21,7 @@ public class TaskCsfGeneratorTest public void JsonV1Test() { TaskItem item = new(Path.Combine(Assets, InputJsonV1File)); - item.SetMetadata(TaskCsfGenerator.Metadata_Destination, Path.Combine(OutputPath, InputJsonV1File)); + item.SetMetadata(TaskCsfGenerator.Metadata_Intermediate, Path.Combine(OutputPath, InputJsonV1File)); item.SetMetadata(TaskCsfGenerator.Metadata_Type, "JsonV1"); TaskCsfGenerator task = new() @@ -36,7 +36,7 @@ public void JsonV1Test() public void JsonV2Test() { TaskItem item = new(Path.Combine(Assets, InputJsonV2File)); - item.SetMetadata(TaskCsfGenerator.Metadata_Destination, Path.Combine(OutputPath, InputJsonV2File)); + item.SetMetadata(TaskCsfGenerator.Metadata_Intermediate, Path.Combine(OutputPath, InputJsonV2File)); item.SetMetadata(TaskCsfGenerator.Metadata_Type, "JsonV2"); TaskCsfGenerator task = new() @@ -61,7 +61,7 @@ public void Startup() public void UnknownTest() { TaskItem item = new(Path.Combine(Assets, InputXmlV1File)); - item.SetMetadata(TaskCsfGenerator.Metadata_Destination, Path.Combine(OutputPath, "Unknown")); + item.SetMetadata(TaskCsfGenerator.Metadata_Intermediate, Path.Combine(OutputPath, "Unknown")); item.SetMetadata(TaskCsfGenerator.Metadata_Type, "Unknown"); TaskCsfGenerator task = new() @@ -76,7 +76,7 @@ public void UnknownTest() public void XmlV1Test() { TaskItem item = new(Path.Combine(Assets, InputXmlV1File)); - item.SetMetadata(TaskCsfGenerator.Metadata_Destination, Path.Combine(OutputPath, InputXmlV1File)); + item.SetMetadata(TaskCsfGenerator.Metadata_Intermediate, Path.Combine(OutputPath, InputXmlV1File)); item.SetMetadata(TaskCsfGenerator.Metadata_Type, "XmlV1"); TaskCsfGenerator task = new() @@ -91,7 +91,7 @@ public void XmlV1Test() public void YamlV1Test() { TaskItem item = new(Path.Combine(Assets, InputYamlV1File)); - item.SetMetadata(TaskCsfGenerator.Metadata_Destination, Path.Combine(OutputPath, InputYamlV1File)); + item.SetMetadata(TaskCsfGenerator.Metadata_Intermediate, Path.Combine(OutputPath, InputYamlV1File)); item.SetMetadata(TaskCsfGenerator.Metadata_Type, "YamlV1"); TaskCsfGenerator task = new() diff --git a/test/Shimakaze.Sdk.Build.Tests/TaskIniMergerTest.cs b/test/Shimakaze.Sdk.Build.Tests/TaskIniMergerTest.cs index 00ea700b..57194b92 100644 --- a/test/Shimakaze.Sdk.Build.Tests/TaskIniMergerTest.cs +++ b/test/Shimakaze.Sdk.Build.Tests/TaskIniMergerTest.cs @@ -18,13 +18,11 @@ public class TaskIniMergerTest public void MergeTest() { TaskItem item = new(Path.Combine(Assets, InputFile)); - item.SetMetadata(TaskIniMerger.Metadata_Type, "Rule"); - TaskItem output = new("Rule"); - output.SetMetadata(TaskIniMerger.Metadata_Destination, Path.Combine(OutputPath, InputFile)); + TaskIniMerger task = new() { SourceFiles = new[] { item }, - DestinationFiles = new[] { output }, + DestinationFile = Path.Combine(OutputPath, InputFile), BuildEngine = _buildEngine?.Object, }; Assert.IsTrue(task.Execute()); diff --git a/test/Shimakaze.Sdk.Build.Tests/TaskMixGenneratorTest.cs b/test/Shimakaze.Sdk.Build.Tests/TaskMixGeneratorTest.cs similarity index 93% rename from test/Shimakaze.Sdk.Build.Tests/TaskMixGenneratorTest.cs rename to test/Shimakaze.Sdk.Build.Tests/TaskMixGeneratorTest.cs index 7406d95c..b66fe0fb 100644 --- a/test/Shimakaze.Sdk.Build.Tests/TaskMixGenneratorTest.cs +++ b/test/Shimakaze.Sdk.Build.Tests/TaskMixGeneratorTest.cs @@ -6,7 +6,7 @@ namespace Shimakaze.Sdk.Build.Tests; [TestClass] -public class TaskMixGenneratorTest +public class TaskMixGeneratorTest { private const string Assets = "Assets"; private const string InputFile = "ra2md.csf"; @@ -30,7 +30,7 @@ public void Test() { TaskItem item = new(Path.Combine(Assets, InputFile)); - TaskMixGennerator task = new() + TaskMixGenerator task = new() { SourceFiles = new[] { item }, DestinationFile = Path.Combine(OutputPath, OutputFile),