From 17671611b22b5e295d99184ea1def7f30b741403 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Fri, 16 Dec 2022 16:44:04 +0100 Subject: [PATCH] Fix duplicate entries warning If generated sources already exist don't add them to _outputFiles. --- Ryujinx.CustomTasks/GenerateArrays.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Ryujinx.CustomTasks/GenerateArrays.cs b/Ryujinx.CustomTasks/GenerateArrays.cs index 70f91f1..267b7ad 100644 --- a/Ryujinx.CustomTasks/GenerateArrays.cs +++ b/Ryujinx.CustomTasks/GenerateArrays.cs @@ -55,8 +55,20 @@ namespace Ryujinx.CustomTasks private void AddGeneratedSource(string filePath, string content) { + bool addToOutputFiles = true; + + if (File.Exists(filePath)) + { + File.Delete(filePath); + addToOutputFiles = false; + } + File.WriteAllText(filePath, content); - _outputFiles.Add(filePath); + + if (addToOutputFiles) + { + _outputFiles.Add(filePath); + } } private HashSet GetArraySizes(string itemPath) @@ -174,9 +186,6 @@ namespace Ryujinx.CustomTasks string arraysFilePath = Path.Combine(OutputPath, ArraysFileName); List arraySizes = new List(); - File.Delete(interfaceFilePath); - File.Delete(arraysFilePath); - foreach (var item in InputFiles) { string fullPath = item.GetMetadata("FullPath");