0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2025-01-25 01:11:59 +00:00
Ryujinx/src/Ryujinx.BuildValidationTasks/Program.cs
LotP1 b2e1e553e4
Validation Project v2 (#444)
Refactor of the Validation System for more ease of use in the future.
The project now builds a standalone executable and executes it before
the main project is built or published.
Since it is now a standalone executable we are also able to use .NET
Core features as we are no longer locked to netstandard.

The project currently includes 1 task, LocalesValidationTask, that will
check if the locales.json file has any of the following issues:
The json is invalid.
The json has locales with missing languages.
The json has locales with langauges that are just duplicates of the
en_US field.

If the project is built or published locally it will also fix any
missing languages or duplicate fields.

---------

Co-authored-by: Evan Husted <gr33m11@gmail.com>
Co-authored-by: Evan Husted <greem@greemdev.net>
2024-12-30 01:54:25 -06:00

37 lines
1.2 KiB
C#

using System;
using System.IO;
using System.Linq;
namespace Ryujinx.BuildValidationTasks
{
public class Program
{
static void Main(string[] args)
{
// Display the number of command line arguments.
if (args.Length == 0)
throw new ArgumentException("Error: too few arguments!");
string path = args[0];
if (string.IsNullOrEmpty(path))
throw new ArgumentException("Error: path is null or empty!");
if (!Path.Exists(path))
throw new FileLoadException($"path {{{path}}} does not exist!");
path = Path.GetFullPath(path);
if (!Directory.GetDirectories(path).Contains($"{path}src"))
throw new FileLoadException($"path {{{path}}} is not a valid ryujinx project!");
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);
}
}
}