fix not building locally with dotnet build

This commit is contained in:
LotP1 2024-12-18 21:57:02 +01:00
parent 5e0eca30bc
commit 9588123f53
2 changed files with 11 additions and 5 deletions

View file

@ -14,10 +14,16 @@ namespace Ryujinx.BuildValidationTasks
{ {
string path = System.Reflection.Assembly.GetExecutingAssembly().Location; string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
path = path.Split(new string[] { "src" }, StringSplitOptions.None)[0]; if (path.Split(new string[] { "src" }, StringSplitOptions.None).Length == 1 )
{
//i assume that we are in a build directory in the solution dir
path = new FileInfo(path).Directory.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName; path = new FileInfo(path).Directory.Parent.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName;
}
else
{
path = path.Split(new string[] { "src" }, StringSplitOptions.None)[0];
path = new FileInfo(path).Directory.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName;
}
string data; string data;

View file

@ -11,7 +11,7 @@
<PackageReference Include="Newtonsoft.Json" /> <PackageReference Include="Newtonsoft.Json" />
</ItemGroup> </ItemGroup>
<UsingTask TaskName="Ryujinx.BuildValidationTasks.LocaleValidationTask" TaskFactory="TaskHostFactory" AssemblyFile="$(ProjectDir)bin\$(Configuration)\netstandard2.0\Ryujinx.BuildValidationTasks.dll" /> <UsingTask TaskName="Ryujinx.BuildValidationTasks.LocaleValidationTask" TaskFactory="TaskHostFactory" AssemblyFile="$(TargetDir)Ryujinx.BuildValidationTasks.dll" />
<Target Name="LocalesJsonValidation" AfterTargets="AfterBuild"> <Target Name="LocalesJsonValidation" AfterTargets="AfterBuild">
<LocaleValidationTask /> <LocaleValidationTask />