Validation Project v2 #471

Merged
GreemDev merged 59 commits from validation-v2 into master 2024-12-31 02:31:28 +00:00
3 changed files with 18 additions and 18 deletions
Showing only changes of commit 8efefeaaca - Show all commits

View File

@ -9,7 +9,9 @@ namespace Ryujinx.BuildValidationTasks
{ {
public class LocalesValidationTask : ValidationTask public class LocalesValidationTask : ValidationTask
{ {
public static bool Execute(string projectPath) public LocalesValidationTask() { }
public bool Execute(string projectPath, bool isGitRunner)
{ {
Console.WriteLine("Running Locale Validation Task..."); Console.WriteLine("Running Locale Validation Task...");
@ -23,6 +25,8 @@ namespace Ryujinx.BuildValidationTasks
LocalesJson json; LocalesJson json;
if (isGitRunner && data.Contains("\r\n"))
throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, build locally to fix...");
try try
{ {
@ -34,12 +38,7 @@ namespace Ryujinx.BuildValidationTasks
throw new JsonException(e.Message); //shorter and easier stacktrace throw new JsonException(e.Message); //shorter and easier stacktrace
} }
bool isGitRunner = path.Contains("runner") || path.Contains("D:\\a\\Ryujinx\\Ryujinx");
if (isGitRunner)
Console.WriteLine("Is Git Runner!");
if (isGitRunner && data.Contains("\r\n"))
throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, build locally to fix...");
bool encounteredIssue = false; bool encounteredIssue = false;

View File

@ -12,28 +12,29 @@ namespace Ryujinx.BuildValidationTasks
static void Main(string[] args) static void Main(string[] args)
{ {
// Display the number of command line arguments. // Display the number of command line arguments.
if (args.Length != 1)
{
if (args.Length == 0) if (args.Length == 0)
throw new ArgumentException("Error: too few arguments!"); throw new ArgumentException("Error: too few arguments!");
else
throw new ArgumentException("Error: too many arguments!");
}
string path = args[0]; string path = args[0];
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
throw new ArgumentException("Error: path is null or empty!"); throw new ArgumentException("Error: path is null or empty!");
if (!Path.Exists(args[0])) if (!Path.Exists(path))
throw new ArgumentException($"path {{{path}}} does not exist!"); throw new FileLoadException($"path {{{path}}} does not exist!");
path = Path.GetFullPath(path); path = Path.GetFullPath(path);
if (!Directory.GetDirectories(path).Contains($"{path}src")) if (!Directory.GetDirectories(path).Contains($"{path}src"))
throw new ArgumentException($"path {{{path}}} is not a valid ryujinx project!"); throw new FileLoadException($"path {{{path}}} is not a valid ryujinx project!");
LocalesValidationTask.Execute(path); bool isGitRunner = path.Contains("runner") || path.Contains("D:\\a\\Ryujinx\\Ryujinx");
if (isGitRunner)
Console.WriteLine("Is Git Runner!");
// Run tasks
// Pass extra info needed in the task constructors
new LocalesValidationTask().Execute(path, isGitRunner);
} }
} }
} }

View File

@ -8,6 +8,6 @@ namespace Ryujinx.BuildValidationTasks
{ {
public interface ValidationTask public interface ValidationTask
{ {
public static bool Execute(string projectPath) { return true; } public bool Execute(string projectPath, bool isGitRunner);
} }
} }