From af835e2fac472e03e88f2f2b24b41cc84e78361e Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Fri, 16 Dec 2022 22:51:27 +0100 Subject: [PATCH] GenArray: Replace input properties --- Ryujinx.CustomTasks/GenerateArrays.cs | 22 ++++++++++++++----- .../build/Ryujinx.CustomTasks.targets | 13 ++++++++--- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Ryujinx.CustomTasks/GenerateArrays.cs b/Ryujinx.CustomTasks/GenerateArrays.cs index 267b7ad..aad6127 100644 --- a/Ryujinx.CustomTasks/GenerateArrays.cs +++ b/Ryujinx.CustomTasks/GenerateArrays.cs @@ -25,7 +25,19 @@ namespace Ryujinx.CustomTasks public string OutputPath { get; set; } [Required] - public ITaskItem[] InputFiles { get; set; } + public bool ScanSolution { get; set; } + + [Required] + public string SolutionDir { get; set; } + + [Required] + public string ProjectDir { get; set; } + + [Required] + public string NugetPackagePath { get; set; } + + [Required] + public string TargetFramework { get; set; } [Output] public string[] OutputFiles { get; set; } @@ -186,16 +198,14 @@ namespace Ryujinx.CustomTasks string arraysFilePath = Path.Combine(OutputPath, ArraysFileName); List arraySizes = new List(); - foreach (var item in InputFiles) + foreach (var item in Directory.EnumerateFiles(ScanSolution ? SolutionDir: ProjectDir, "*.cs", SearchOption.AllDirectories)) { - string fullPath = item.GetMetadata("FullPath"); - - if (fullPath.EndsWith(".g.cs") || fullPath.Contains(Path.Combine("obj","Debug")) || fullPath.Contains(Path.Combine("obj", "Release"))) + if (item.EndsWith(".g.cs") || item.Contains(Path.Combine("obj","Debug")) || item.Contains(Path.Combine("obj", "Release"))) { continue; } - foreach (int size in GetArraySizes(fullPath)) + foreach (int size in GetArraySizes(item)) { if (!arraySizes.Contains(size)) { diff --git a/Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets b/Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets index 13c2e07..5720276 100644 --- a/Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets +++ b/Ryujinx.CustomTasks/build/Ryujinx.CustomTasks.targets @@ -3,16 +3,23 @@ - + + + false + + - + + - +