Merge pull request #2113 from wabbajack-tools/3.0.2_updates

3.0.2 updates
This commit is contained in:
Timothy Baldridge
2022-10-14 17:02:33 -06:00
committed by GitHub
38 changed files with 290 additions and 122 deletions

View File

@ -1,5 +1,9 @@
### Changelog
#### Version - 3.0.2.0 - 10/14/2022
* Show Modlist readmes after install
* Basic support for commandline options in the WPF app
#### Version - 3.0.1.9 - 10/4/2022
* Lots of compiler improvements for faster compilation
* Limit the log view to the last 200 messages for better UI performance

View File

@ -1,6 +1,7 @@
using System;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Microsoft.Extensions.DependencyInjection;
@ -9,6 +10,7 @@ using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
using NLog.Targets;
using ReactiveUI;
using Wabbajack.CLI.Builder;
using Wabbajack.DTOs;
using Wabbajack.DTOs.Interventions;
using Wabbajack.Interventions;
@ -27,10 +29,9 @@ namespace Wabbajack
/// </summary>
public partial class App
{
private readonly IServiceProvider _serviceProvider;
private readonly IHost _host;
private IHost _host;
public App()
private void OnStartup(object sender, StartupEventArgs e)
{
WebView2AutoInstaller.CheckAndInstallAsync(false, false).Wait();
@ -42,8 +43,28 @@ namespace Wabbajack
ConfigureServices(services);
})
.Build();
var args = e.Args;
_serviceProvider = _host.Services;
RxApp.MainThreadScheduler.Schedule(0, (_, _) =>
{
if (args.Length > 0)
{
var builder = _host.Services.GetRequiredService<CommandLineBuilder>();
builder.Run(e.Args).ContinueWith(async x =>
{
Environment.Exit(await x);
});
return Disposable.Empty;
}
else
{
var mainWindow = _host.Services.GetRequiredService<MainWindow>();
mainWindow!.Show();
return Disposable.Empty;
}
});
}
private void AddLogging(ILoggingBuilder loggingBuilder)
@ -119,17 +140,13 @@ namespace Wabbajack
services.AddSingleton<ManualDownloadHandler>();
services.AddSingleton<ManualBlobDownloadHandler>();
// Verbs
services.AddSingleton<CommandLineBuilder>();
services.AddCLIVerbs();
return services;
}
private void OnStartup(object sender, StartupEventArgs e)
{
RxApp.MainThreadScheduler.Schedule(0, (_, _) =>
{
var mainWindow = _serviceProvider.GetRequiredService<MainWindow>();
mainWindow!.Show();
return Disposable.Empty;
});
}
private void OnExit(object sender, ExitEventArgs e)
{

View File

@ -0,0 +1,13 @@

using Microsoft.Extensions.DependencyInjection;
namespace Wabbajack;
using Wabbajack.Verbs;
using Wabbajack.CLI.Builder;
public static class CommandLineBuilderExtensions{
public static void AddCLIVerbs(this IServiceCollection services) {
CommandLineBuilder.RegisterCommand<NexusLogin>(NexusLogin.Definition, c => ((NexusLogin)c).Run);
services.AddSingleton<NexusLogin>();
}
}

View File

@ -0,0 +1,29 @@
<#@ template language="C#v3.5" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.IO"#>
<#@ import namespace="System.Collections.Generic" #>
using Microsoft.Extensions.DependencyInjection;
namespace Wabbajack;
using Wabbajack.Verbs;
using Wabbajack.CLI.Builder;
public static class CommandLineBuilderExtensions{
public static void AddCLIVerbs(this IServiceCollection services) {
<#
foreach (var verb in Directory.EnumerateFiles("Verbs"))
{
var klass = verb.Split('\\').Last().Split('.').First();
if (klass == "IVerb") continue;
#>
CommandLineBuilder.RegisterCommand<<#=klass#>>(<#=klass#>.Definition, c => ((<#=klass#>)c).Run);
services.AddSingleton<<#=klass#>>();
<#
}
#>
}
}

View File

@ -0,0 +1,36 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.UserIntervention;
namespace Wabbajack.Verbs;
public class NexusLogin
{
private readonly ILogger<NexusLogin> _logger;
private readonly IServiceProvider _services;
public NexusLogin(ILogger<NexusLogin> logger, IServiceProvider services)
{
_logger = logger;
_services = services;
}
public static VerbDefinition Definition = new("nexus-login", "Log into the Nexus via the normal browser method",
Array.Empty<OptionDefinition>());
public async Task<int> Run(CancellationToken token)
{
var tcs = new TaskCompletionSource<int>();
var view = new BrowserWindow();
view.Closed += (sender, args) => { tcs.TrySetResult(0); };
var provider = _services.GetRequiredService<NexusLoginHandler>();
view.DataContext = provider;
view.Show();
return await tcs.Task;
}
}

View File

@ -325,6 +325,10 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
ModList = await StandardInstaller.LoadFromFile(_dtos, path);
ModListImage = BitmapFrame.Create(await StandardInstaller.ModListImageStream(path));
if (!string.IsNullOrWhiteSpace(ModList.Readme))
UIUtils.OpenWebsite(new Uri(ModList.Readme));
StatusText = $"Install configuration for {ModList.Name}";
TaskBarUpdate.Send($"Loaded {ModList.Name}", TaskbarItemProgressState.Normal);
@ -377,7 +381,6 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
if (await downloader.Prepare())
continue;
var manager = _logins
.FirstOrDefault(l => l.LoginFor() == downloader.GetType());
if (manager == null)
@ -446,6 +449,10 @@ public class InstallerVM : BackNavigatingVM, IBackNavigatingVM, ICpuStatusVM
{
TaskBarUpdate.Send($"Finished install of {ModList.Name}", TaskbarItemProgressState.Normal);
InstallState = InstallState.Success;
if (!string.IsNullOrWhiteSpace(ModList.Readme))
UIUtils.OpenWebsite(new Uri(ModList.Readme));
}
}
catch (Exception ex)

View File

@ -61,6 +61,15 @@
<None Remove="Resources\Wabba_Mouth_Small.png" />
<Compile Remove="View Models\Compilers\VortexCompilerVM.cs" />
<Compile Remove="View Models\Installers\VortexInstallerVM.cs" />
<None Update="VerbRegistration.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>VerbRegistration.cs</LastGenOutput>
</None>
<Compile Update="VerbRegistration.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>VerbRegistration.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
@ -81,7 +90,7 @@
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.11.0" />
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.2-mauipre.1.22102.15" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1343.22" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.0.4" />
<PackageReference Include="PInvoke.User32" Version="0.7.124" />
@ -95,6 +104,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wabbajack.CLI.Builder\Wabbajack.CLI.Builder.csproj" />
<ProjectReference Include="..\Wabbajack.Services.OSIntegrated\Wabbajack.Services.OSIntegrated.csproj" />
</ItemGroup>

View File

@ -1,31 +1,20 @@
using System;
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.ComponentModel.Design;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Wabbajack.CLI.Verbs;
using Wabbajack.Paths;
using Wabbajack.Services.OSIntegrated;
namespace Wabbajack.CLI;
namespace Wabbajack.CLI.Builder;
public partial class CommandLineBuilder
public class CommandLineBuilder
{
private static IServiceProvider _provider;
public CommandLineBuilder(IServiceProvider provider, IConsole console, LoggingRateLimiterReporter _)
public CommandLineBuilder(IServiceProvider provider)
{
_provider = provider;
}
static CommandLineBuilder()
{
RegisterAll();
}
public async Task<int> Run(string[] args)
{
var root = new RootCommand();
@ -58,7 +47,7 @@ public partial class CommandLineBuilder
};
private Command MakeCommend(Type verbType, Func<IVerb, Delegate> verbHandler, VerbDefinition definition)
private Command MakeCommend(Type verbType, Func<object, Delegate> verbHandler, VerbDefinition definition)
{
var command = new Command(definition.Name, definition.Description);
foreach (var option in definition.Options)
@ -73,9 +62,9 @@ public partial class CommandLineBuilder
{
private IServiceProvider _provider;
private Type _type;
private readonly Func<IVerb, Delegate> _delgate;
private readonly Func<object, Delegate> _delgate;
public HandlerDelegate(IServiceProvider provider, Type type, Func<IVerb, Delegate> inner)
public HandlerDelegate(IServiceProvider provider, Type type, Func<object, Delegate> inner)
{
_provider = provider;
_type = type;
@ -83,22 +72,23 @@ public partial class CommandLineBuilder
}
public int Invoke(InvocationContext context)
{
var service = (IVerb)_provider.GetRequiredService(_type);
var service = _provider.GetRequiredService(_type);
var handler = CommandHandler.Create(_delgate(service));
return handler.Invoke(context);
}
public Task<int> InvokeAsync(InvocationContext context)
{
var service = (IVerb)_provider.GetRequiredService(_type);
var service = _provider.GetRequiredService(_type);
var handler = CommandHandler.Create(_delgate(service));
return handler.InvokeAsync(context);
}
}
private static List<(Type Type, VerbDefinition Definition, Func<IVerb, Delegate> Handler)> _commands { get; set; } = new();
private static List<(Type Type, VerbDefinition Definition, Func<object, Delegate> Handler)> _commands { get; set; } = new();
public static IEnumerable<Type> Verbs => _commands.Select(c => c.Type);
public static void RegisterCommand<T>(VerbDefinition definition, Func<IVerb, Delegate> handler)
public static void RegisterCommand<T>(VerbDefinition definition, Func<object, Delegate> handler)
{
_commands.Add((typeof(T), definition, handler));
@ -120,17 +110,3 @@ public record VerbDefinition(string Name, string Description, OptionDefinition[]
{
}
public static class CommandLineBuilderExtensions
{
public static IServiceCollection AddCommands(this IServiceCollection services)
{
services.AddSingleton<CommandLineBuilder>();
foreach (var verb in CommandLineBuilder.Verbs)
{
services.AddSingleton(verb);
}
return services;
}
}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.2-mauipre.1.22102.15" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.2-mauipre.1.22102.15" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.2-mauipre.1.22102.15" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.2-mauipre.1.22102.15" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.2" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wabbajack.Paths\Wabbajack.Paths.csproj" />
</ItemGroup>
</Project>

View File

@ -18,6 +18,7 @@ using Wabbajack.Server.Lib;
using Wabbajack.Services.OSIntegrated;
using Wabbajack.VFS;
using Client = Wabbajack.Networking.GitHub.Client;
using Wabbajack.CLI.Builder;
namespace Wabbajack.CLI;
@ -46,7 +47,13 @@ internal class Program
services.AddTransient<Context>();
services.AddCommands();
services.AddSingleton<CommandLineBuilder>();
services.AddCLIVerbs();
services.AddSingleton<IUserInterventionHandler, UserInterventionHandler>();
}).Build();

View File

@ -1,32 +1,57 @@

using Microsoft.Extensions.DependencyInjection;
namespace Wabbajack.CLI;
using Wabbajack.CLI.Verbs;
using Wabbajack.CLI.Builder;
public partial class CommandLineBuilder {
public static class CommandLineBuilderExtensions{
private static void RegisterAll() {
RegisterCommand<Compile>(Compile.Definition, c => ((Compile)c).Run);
RegisterCommand<Decrypt>(Decrypt.Definition, c => ((Decrypt)c).Run);
RegisterCommand<DownloadAll>(DownloadAll.Definition, c => ((DownloadAll)c).Run);
RegisterCommand<DownloadUrl>(DownloadUrl.Definition, c => ((DownloadUrl)c).Run);
RegisterCommand<DumpZipInfo>(DumpZipInfo.Definition, c => ((DumpZipInfo)c).Run);
RegisterCommand<Encrypt>(Encrypt.Definition, c => ((Encrypt)c).Run);
RegisterCommand<Extract>(Extract.Definition, c => ((Extract)c).Run);
RegisterCommand<ForceHeal>(ForceHeal.Definition, c => ((ForceHeal)c).Run);
RegisterCommand<HashFile>(HashFile.Definition, c => ((HashFile)c).Run);
RegisterCommand<HashUrlString>(HashUrlString.Definition, c => ((HashUrlString)c).Run);
RegisterCommand<Install>(Install.Definition, c => ((Install)c).Run);
RegisterCommand<InstallCompileInstallVerify>(InstallCompileInstallVerify.Definition, c => ((InstallCompileInstallVerify)c).Run);
RegisterCommand<ListCreationClubContent>(ListCreationClubContent.Definition, c => ((ListCreationClubContent)c).Run);
RegisterCommand<ListGames>(ListGames.Definition, c => ((ListGames)c).Run);
RegisterCommand<ListModlists>(ListModlists.Definition, c => ((ListModlists)c).Run);
RegisterCommand<MirrorFile>(MirrorFile.Definition, c => ((MirrorFile)c).Run);
RegisterCommand<ModlistReport>(ModlistReport.Definition, c => ((ModlistReport)c).Run);
RegisterCommand<SteamDownloadFile>(SteamDownloadFile.Definition, c => ((SteamDownloadFile)c).Run);
RegisterCommand<SteamDumpAppInfo>(SteamDumpAppInfo.Definition, c => ((SteamDumpAppInfo)c).Run);
RegisterCommand<SteamLogin>(SteamLogin.Definition, c => ((SteamLogin)c).Run);
RegisterCommand<UploadToNexus>(UploadToNexus.Definition, c => ((UploadToNexus)c).Run);
RegisterCommand<ValidateLists>(ValidateLists.Definition, c => ((ValidateLists)c).Run);
RegisterCommand<VFSIndex>(VFSIndex.Definition, c => ((VFSIndex)c).Run);
public static void AddCLIVerbs(this IServiceCollection services) {
CommandLineBuilder.RegisterCommand<Compile>(Compile.Definition, c => ((Compile)c).Run);
services.AddSingleton<Compile>();
CommandLineBuilder.RegisterCommand<Decrypt>(Decrypt.Definition, c => ((Decrypt)c).Run);
services.AddSingleton<Decrypt>();
CommandLineBuilder.RegisterCommand<DownloadAll>(DownloadAll.Definition, c => ((DownloadAll)c).Run);
services.AddSingleton<DownloadAll>();
CommandLineBuilder.RegisterCommand<DownloadUrl>(DownloadUrl.Definition, c => ((DownloadUrl)c).Run);
services.AddSingleton<DownloadUrl>();
CommandLineBuilder.RegisterCommand<DumpZipInfo>(DumpZipInfo.Definition, c => ((DumpZipInfo)c).Run);
services.AddSingleton<DumpZipInfo>();
CommandLineBuilder.RegisterCommand<Encrypt>(Encrypt.Definition, c => ((Encrypt)c).Run);
services.AddSingleton<Encrypt>();
CommandLineBuilder.RegisterCommand<Extract>(Extract.Definition, c => ((Extract)c).Run);
services.AddSingleton<Extract>();
CommandLineBuilder.RegisterCommand<ForceHeal>(ForceHeal.Definition, c => ((ForceHeal)c).Run);
services.AddSingleton<ForceHeal>();
CommandLineBuilder.RegisterCommand<HashFile>(HashFile.Definition, c => ((HashFile)c).Run);
services.AddSingleton<HashFile>();
CommandLineBuilder.RegisterCommand<HashUrlString>(HashUrlString.Definition, c => ((HashUrlString)c).Run);
services.AddSingleton<HashUrlString>();
CommandLineBuilder.RegisterCommand<Install>(Install.Definition, c => ((Install)c).Run);
services.AddSingleton<Install>();
CommandLineBuilder.RegisterCommand<InstallCompileInstallVerify>(InstallCompileInstallVerify.Definition, c => ((InstallCompileInstallVerify)c).Run);
services.AddSingleton<InstallCompileInstallVerify>();
CommandLineBuilder.RegisterCommand<ListCreationClubContent>(ListCreationClubContent.Definition, c => ((ListCreationClubContent)c).Run);
services.AddSingleton<ListCreationClubContent>();
CommandLineBuilder.RegisterCommand<ListGames>(ListGames.Definition, c => ((ListGames)c).Run);
services.AddSingleton<ListGames>();
CommandLineBuilder.RegisterCommand<ListModlists>(ListModlists.Definition, c => ((ListModlists)c).Run);
services.AddSingleton<ListModlists>();
CommandLineBuilder.RegisterCommand<MirrorFile>(MirrorFile.Definition, c => ((MirrorFile)c).Run);
services.AddSingleton<MirrorFile>();
CommandLineBuilder.RegisterCommand<ModlistReport>(ModlistReport.Definition, c => ((ModlistReport)c).Run);
services.AddSingleton<ModlistReport>();
CommandLineBuilder.RegisterCommand<SteamDownloadFile>(SteamDownloadFile.Definition, c => ((SteamDownloadFile)c).Run);
services.AddSingleton<SteamDownloadFile>();
CommandLineBuilder.RegisterCommand<SteamDumpAppInfo>(SteamDumpAppInfo.Definition, c => ((SteamDumpAppInfo)c).Run);
services.AddSingleton<SteamDumpAppInfo>();
CommandLineBuilder.RegisterCommand<SteamLogin>(SteamLogin.Definition, c => ((SteamLogin)c).Run);
services.AddSingleton<SteamLogin>();
CommandLineBuilder.RegisterCommand<UploadToNexus>(UploadToNexus.Definition, c => ((UploadToNexus)c).Run);
services.AddSingleton<UploadToNexus>();
CommandLineBuilder.RegisterCommand<ValidateLists>(ValidateLists.Definition, c => ((ValidateLists)c).Run);
services.AddSingleton<ValidateLists>();
CommandLineBuilder.RegisterCommand<VFSIndex>(VFSIndex.Definition, c => ((VFSIndex)c).Run);
services.AddSingleton<VFSIndex>();
}
}

View File

@ -5,19 +5,22 @@
<#@ import namespace="System.IO"#>
<#@ import namespace="System.Collections.Generic" #>
using Microsoft.Extensions.DependencyInjection;
namespace Wabbajack.CLI;
using Wabbajack.CLI.Verbs;
using Wabbajack.CLI.Builder;
public partial class CommandLineBuilder {
public static class CommandLineBuilderExtensions{
private static void RegisterAll() {
public static void AddCLIVerbs(this IServiceCollection services) {
<#
foreach (var verb in Directory.EnumerateFiles("Verbs"))
{
var klass = verb.Split('\\').Last().Split('.').First();
if (klass == "IVerb") continue;
#>
RegisterCommand<<#=klass#>>(<#=klass#>.Definition, c => ((<#=klass#>)c).Run);
CommandLineBuilder.RegisterCommand<<#=klass#>>(<#=klass#>.Definition, c => ((<#=klass#>)c).Run);
services.AddSingleton<<#=klass#>>();
<#
}

View File

@ -4,6 +4,7 @@ using System.CommandLine.NamingConventionBinder;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Compiler;
using Wabbajack.Downloaders;
using Wabbajack.Downloaders.GameFile;
@ -14,7 +15,7 @@ using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class Compile : IVerb
public class Compile
{
private readonly ILogger<Compile> _logger;
private readonly Client _wjClient;

View File

@ -4,13 +4,14 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
using Wabbajack.Services.OSIntegrated;
namespace Wabbajack.CLI.Verbs;
public class Decrypt : IVerb
public class Decrypt
{
private readonly ILogger<Decrypt> _logger;

View File

@ -6,6 +6,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Downloaders;
using Wabbajack.DTOs;
@ -20,7 +21,7 @@ using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class DownloadAll : IVerb
public class DownloadAll
{
private readonly DownloadDispatcher _dispatcher;
private readonly ILogger<DownloadAll> _logger;

View File

@ -5,6 +5,7 @@ using System.CommandLine.NamingConventionBinder;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Downloaders;
using Wabbajack.DTOs;
@ -13,7 +14,7 @@ using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class DownloadUrl : IVerb
public class DownloadUrl
{
private readonly DownloadDispatcher _dispatcher;
private readonly ILogger<DownloadUrl> _logger;

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Compression.Zip;
using Wabbajack.Downloaders;
@ -16,7 +17,7 @@ using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class DumpZipInfo : IVerb
public class DumpZipInfo
{
private readonly ILogger<DumpZipInfo> _logger;

View File

@ -3,13 +3,14 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
using Wabbajack.Services.OSIntegrated;
namespace Wabbajack.CLI.Verbs;
public class Encrypt : IVerb
public class Encrypt
{
private readonly ILogger<Encrypt> _logger;

View File

@ -5,6 +5,7 @@ using System.CommandLine.NamingConventionBinder;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Downloaders;
using Wabbajack.DTOs;
@ -13,7 +14,7 @@ using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class Extract : IVerb
public class Extract
{
private readonly ILogger<DownloadUrl> _logger;

View File

@ -9,6 +9,7 @@ using System.Threading;
using System.Threading.Tasks;
using FluentFTP.Helpers;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Compiler.PatchCache;
using Wabbajack.Downloaders;
@ -25,7 +26,7 @@ using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class ForceHeal : IVerb
public class ForceHeal
{
private readonly ILogger<ForceHeal> _logger;
private readonly Client _client;

View File

@ -5,13 +5,14 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Hashing.xxHash64;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class HashFile : IVerb
public class HashFile
{
private readonly ILogger<HashFile> _logger;

View File

@ -3,12 +3,13 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Hashing.xxHash64;
using Wabbajack.Paths;
namespace Wabbajack.CLI.Verbs;
public class HashUrlString : IVerb
public class HashUrlString
{
private readonly ILogger<HashUrlString> _logger;

View File

@ -1,7 +0,0 @@
using System.CommandLine;
namespace Wabbajack.CLI.Verbs;
public interface IVerb
{
}

View File

@ -6,6 +6,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Downloaders;
using Wabbajack.Downloaders.GameFile;
using Wabbajack.DTOs;
@ -18,7 +19,7 @@ using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class Install : IVerb
public class Install
{
private readonly ILogger<Install> _logger;
private readonly Client _wjClient;

View File

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Compiler;
using Wabbajack.Downloaders;
@ -22,7 +23,7 @@ using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class InstallCompileInstallVerify : IVerb
public class InstallCompileInstallVerify
{
private readonly ILogger<InstallCompileInstallVerify> _logger;
private readonly Client _wjClient;
@ -47,7 +48,7 @@ public class InstallCompileInstallVerify : IVerb
_inferencer = inferencer;
}
public static VerbDefinition Definition = new VerbDefinition("install-compile-install-verify",
public static VerbDefinition Definition = new("install-compile-install-verify",
"Installs a modlist, compiles it, installs it again, verifies it", new[]
{
new OptionDefinition(typeof(AbsolutePath), "m", "machineUrl", "Machine url(s) to download"),

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.Downloaders.Bethesda;
using Wabbajack.DTOs;
@ -17,7 +18,7 @@ using Wabbajack.Paths;
namespace Wabbajack.CLI.Verbs;
public class ListCreationClubContent : IVerb
public class ListCreationClubContent
{
private readonly ILogger<ListCreationClubContent> _logger;
private readonly Client _client;

View File

@ -7,13 +7,14 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Downloaders.GameFile;
using Wabbajack.DTOs;
using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class ListGames : IVerb
public class ListGames
{
private readonly ILogger<ListGames> _logger;
private readonly GameLocator _locator;
@ -24,7 +25,7 @@ public class ListGames : IVerb
_locator = locator;
}
public static VerbDefinition Definition = new VerbDefinition("list-games",
public static VerbDefinition Definition = new("list-games",
"Lists all games Wabbajack recognizes, and their installed versions/locations (if any)", Array.Empty<OptionDefinition>());
internal Task<int> Run(CancellationToken token)

View File

@ -7,12 +7,13 @@ using System.Threading;
using System.Threading.Tasks;
using FluentFTP.Helpers;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.DTOs;
using Wabbajack.Networking.WabbajackClientApi;
namespace Wabbajack.CLI.Verbs;
public class ListModlists : IVerb
public class ListModlists
{
private readonly ILogger<ListCreationClubContent> _logger;
private readonly Client _client;

View File

@ -3,12 +3,13 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Networking.WabbajackClientApi;
using Wabbajack.Paths;
namespace Wabbajack.CLI.Verbs;
public class MirrorFile : IVerb
public class MirrorFile
{
private readonly ILogger<MirrorFile> _logger;
private readonly Client _client;

View File

@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Nettle;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.DTOs.Directives;
using Wabbajack.DTOs.JsonConverters;
@ -19,7 +20,7 @@ using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class ModlistReport : IVerb
public class ModlistReport
{
private readonly ILogger<ModlistReport> _logger;
private readonly DTOSerializer _dtos;

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using FluentFTP.Helpers;
using Microsoft.Extensions.Logging;
using SteamKit2;
using Wabbajack.CLI.Builder;
using Wabbajack.DTOs;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.Networking.Http.Interfaces;
@ -15,7 +16,7 @@ using Wabbajack.Paths;
namespace Wabbajack.CLI.Verbs;
public class SteamDownloadFile : IVerb
public class SteamDownloadFile
{
private readonly ILogger<SteamDownloadFile> _logger;
private readonly Client _client;
@ -35,7 +36,7 @@ public class SteamDownloadFile : IVerb
_wjClient = wjClient;
}
public static VerbDefinition Definition = new VerbDefinition("steam-download-file",
public static VerbDefinition Definition = new("steam-download-file",
"Dumps information to the console about the given app",
new[]
{

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using SteamKit2;
using Wabbajack.CLI.Builder;
using Wabbajack.DTOs;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.Networking.Http.Interfaces;
@ -15,7 +16,7 @@ using JsonSerializer = System.Text.Json.JsonSerializer;
namespace Wabbajack.CLI.Verbs;
public class SteamDumpAppInfo : IVerb
public class SteamDumpAppInfo
{
private readonly ILogger<SteamDumpAppInfo> _logger;
private readonly Client _client;
@ -33,7 +34,7 @@ public class SteamDumpAppInfo : IVerb
_dtos = dtos;
}
public static VerbDefinition Definition = new VerbDefinition("steam-app-dump-info",
public static VerbDefinition Definition = new("steam-app-dump-info",
"Dumps information to the console about the given app", new[]
{
new OptionDefinition(typeof(string), "g", "game", "Wabbajack game name")

View File

@ -4,13 +4,14 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Networking.Http.Interfaces;
using Wabbajack.Networking.Steam;
using Wabbajack.Paths;
namespace Wabbajack.CLI.Verbs;
public class SteamLogin : IVerb
public class SteamLogin
{
private readonly ILogger<SteamLogin> _logger;
private readonly Client _client;

View File

@ -1,20 +1,16 @@
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Wabbajack.CLI.Builder;
using Wabbajack.Common;
using Wabbajack.DTOs.JsonConverters;
using Wabbajack.Networking.NexusApi;
using Wabbajack.Networking.NexusApi.DTOs;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
namespace Wabbajack.CLI.Verbs;
public class UploadToNexus : IVerb
public class UploadToNexus
{
private readonly ILogger<UploadToNexus> _logger;
private readonly NexusApi _client;

View File

@ -3,12 +3,13 @@ using System.CommandLine.Invocation;
using System.CommandLine.NamingConventionBinder;
using System.Threading;
using System.Threading.Tasks;
using Wabbajack.CLI.Builder;
using Wabbajack.Paths;
using Wabbajack.VFS;
namespace Wabbajack.CLI.Verbs;
public class VFSIndex : IVerb
public class VFSIndex
{
private readonly Context _context;
@ -17,7 +18,7 @@ public class VFSIndex : IVerb
_context = context;
}
public static VerbDefinition Definition = new VerbDefinition("vfs-index",
public static VerbDefinition Definition = new("vfs-index",
"Index and cache the contents of a folder", new[]
{
new OptionDefinition(typeof(AbsolutePath), "f", "folder", "Folder to index")

View File

@ -12,6 +12,7 @@ using Microsoft.Extensions.Logging;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Webp;
using SixLabors.ImageSharp.Processing;
using Wabbajack.CLI.Builder;
using Wabbajack.CLI.Services;
using Wabbajack.Common;
using Wabbajack.Compression.Zip;
@ -35,7 +36,7 @@ using Wabbajack.Server.Lib.TokenProviders;
namespace Wabbajack.CLI.Verbs;
public class ValidateLists : IVerb
public class ValidateLists
{
private static readonly Uri MirrorPrefix = new("https://mirror.wabbajack.org");
private readonly WriteOnlyClient _discord;
@ -74,7 +75,7 @@ public class ValidateLists : IVerb
_httpLimiter = httpLimiter;
}
public static VerbDefinition Definition = new VerbDefinition("validate-lists",
public static VerbDefinition Definition = new("validate-lists",
"Gets a list of modlists, validates them and exports a result list", new[]
{
new OptionDefinition(typeof(AbsolutePath), "r", "reports", "Location to store validation report outputs")

View File

@ -29,6 +29,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wabbajack.CLI.Builder\Wabbajack.CLI.Builder.csproj" />
<ProjectReference Include="..\Wabbajack.Downloaders.Bethesda\Wabbajack.Downloaders.Bethesda.csproj" />
<ProjectReference Include="..\Wabbajack.Downloaders.Dispatcher\Wabbajack.Downloaders.Dispatcher.csproj" />
<ProjectReference Include="..\Wabbajack.Hashing.xxHash64\Wabbajack.Hashing.xxHash64.csproj" />

View File

@ -141,6 +141,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.App.Wpf", "Wabbaj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.VFS.Interfaces", "Wabbajack.VFS.Interfaces\Wabbajack.VFS.Interfaces.csproj", "{E4BDB22D-11A4-452F-8D10-D9CA9777EA22}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.CLI.Builder", "Wabbajack.CLI.Builder\Wabbajack.CLI.Builder.csproj", "{99CD51A1-38C9-420E-9497-2C9AEAF0053C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -387,6 +389,10 @@ Global
{E4BDB22D-11A4-452F-8D10-D9CA9777EA22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4BDB22D-11A4-452F-8D10-D9CA9777EA22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4BDB22D-11A4-452F-8D10-D9CA9777EA22}.Release|Any CPU.Build.0 = Release|Any CPU
{99CD51A1-38C9-420E-9497-2C9AEAF0053C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99CD51A1-38C9-420E-9497-2C9AEAF0053C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99CD51A1-38C9-420E-9497-2C9AEAF0053C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99CD51A1-38C9-420E-9497-2C9AEAF0053C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE