Fix duplicate entries warning

If generated sources already exist don't add them to _outputFiles.
This commit is contained in:
TSR Berry 2022-12-16 16:44:04 +01:00
parent c83f21e932
commit 17671611b2
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2

View file

@ -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<int> GetArraySizes(string itemPath)
@ -174,9 +186,6 @@ namespace Ryujinx.CustomTasks
string arraysFilePath = Path.Combine(OutputPath, ArraysFileName);
List<int> arraySizes = new List<int>();
File.Delete(interfaceFilePath);
File.Delete(arraysFilePath);
foreach (var item in InputFiles)
{
string fullPath = item.GetMetadata("FullPath");