mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-22 05:40:09 -06:00

Original PR had issues in the CI when building. > 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: LotP1 <68976644+LotP1@users.noreply.github.com>
38 lines
1.2 KiB
C#
38 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);
|
|
}
|
|
}
|
|
}
|