mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
At least the app launches
This commit is contained in:
parent
b5006a0737
commit
b8afcfa781
24
Wabbajack.App.Test/BasicUITests.cs
Normal file
24
Wabbajack.App.Test/BasicUITests.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Threading;
|
||||
using Xunit;
|
||||
|
||||
namespace Wabbajack.App.Test
|
||||
{
|
||||
public class BasicUITests
|
||||
{
|
||||
|
||||
[StaFact]
|
||||
public async Task CanCompileASimpleModlist()
|
||||
{
|
||||
|
||||
SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
|
||||
var window = new MainWindow();
|
||||
window.Show();
|
||||
await Task.Delay(1000);
|
||||
|
||||
window.Close();
|
||||
Assert.True(true);
|
||||
}
|
||||
}
|
||||
}
|
20
Wabbajack.App.Test/Wabbajack.App.Test.csproj
Normal file
20
Wabbajack.App.Test/Wabbajack.App.Test.csproj
Normal file
@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<PackageReference Include="Xunit.StaFact" Version="0.3.18" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Wabbajack\Wabbajack.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -42,11 +42,11 @@ namespace Wabbajack.Common
|
||||
});
|
||||
}
|
||||
|
||||
public static T FromJSON<T>(this string filename,
|
||||
public static T FromJSON<T>(this AbsolutePath filename,
|
||||
TypeNameHandling handling = TypeNameHandling.All,
|
||||
TypeNameAssemblyFormatHandling format = TypeNameAssemblyFormatHandling.Full)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(File.ReadAllText(filename),
|
||||
return JsonConvert.DeserializeObject<T>(filename.ReadAllText(),
|
||||
new JsonSerializerSettings {TypeNameHandling = handling,
|
||||
TypeNameAssemblyFormatHandling = format,
|
||||
Converters = Converters
|
||||
|
@ -218,6 +218,7 @@ namespace Wabbajack.Common
|
||||
|
||||
public static explicit operator AbsolutePath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path)) return default;
|
||||
return !Path.IsPathRooted(path) ? ((RelativePath)path).RelativeToEntryPoint() : new AbsolutePath(path);
|
||||
}
|
||||
|
||||
|
@ -17,11 +17,11 @@ namespace Wabbajack.Lib
|
||||
{
|
||||
private static MO2Compiler _mo2Compiler;
|
||||
|
||||
public static string FindzEditPath(ACompiler compiler)
|
||||
public static AbsolutePath FindzEditPath(ACompiler compiler)
|
||||
{
|
||||
_mo2Compiler = (MO2Compiler) compiler;
|
||||
var executables = _mo2Compiler.MO2Ini.customExecutables;
|
||||
if (executables.size == null) return null;
|
||||
if (executables.size == null) return default;
|
||||
|
||||
foreach (var idx in Enumerable.Range(1, int.Parse(executables.size)))
|
||||
{
|
||||
@ -29,10 +29,10 @@ namespace Wabbajack.Lib
|
||||
if (path == null) continue;
|
||||
|
||||
if (path.EndsWith("zEdit.exe"))
|
||||
return Path.GetDirectoryName(path);
|
||||
return (AbsolutePath)path;
|
||||
}
|
||||
|
||||
return null;
|
||||
return default;
|
||||
}
|
||||
|
||||
public class IncludeZEditPatches : ACompilationStep
|
||||
@ -52,9 +52,8 @@ namespace Wabbajack.Lib
|
||||
return;
|
||||
}
|
||||
|
||||
var merges = Directory.EnumerateFiles(Path.Combine(zEditPath, "profiles"),
|
||||
DirectoryEnumerationOptions.Files | DirectoryEnumerationOptions.Recursive)
|
||||
.Where(f => f.EndsWith("\\merges.json"))
|
||||
var merges = zEditPath.Combine("profiles").EnumerateFiles()
|
||||
.Where(f => f.FileName == (RelativePath)"merges.json")
|
||||
.SelectMany(f => f.FromJSON<List<zEditMerge>>())
|
||||
.GroupBy(f => (f.name, f.filename));
|
||||
|
||||
|
@ -40,6 +40,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.Launcher", "Wabba
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.Common.Test", "Wabbajack.Common.Test\Wabbajack.Common.Test.csproj", "{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.App.Test", "Wabbajack.App.Test\Wabbajack.App.Test.csproj", "{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -139,6 +141,14 @@ Global
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Release|x64.ActiveCfg = Release|x64
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Release|x64.Build.0 = Release|x64
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}.Release|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -35,7 +35,7 @@ namespace Wabbajack
|
||||
}
|
||||
|
||||
// Version check
|
||||
settings = JsonConvert.DeserializeObject<MainSettings>(Consts.SettingsFile.ReadAllText());
|
||||
settings = Consts.SettingsFile.FromJSON<MainSettings>();
|
||||
if (settings.Version == Consts.SettingsVersion)
|
||||
return true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user