Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ModdingToolBase
Submodule ModdingToolBase updated 35 files
+2 −2 src/AnakinApps/ApplicationBase.CommandLine/Update/Options/ApplicationUpdateOptions.cs
+1 −0 src/AnakinApps/ApplicationBase.Shared/ApplicationBranchUtilities.cs
+6 −0 src/AnakinApps/ApplicationBase/ApplicationBase.csproj
+1 −1 src/AnakinApps/ApplicationBase/ApplicationBaseServiceExtensions.cs
+5 −3 src/AnakinApps/ApplicationBase/Environment/ApplicationAssemblyInfo.cs
+1 −1 src/AnakinApps/ApplicationBase/Environment/ApplicationEnvironment.cs
+11 −0 src/AnakinApps/ApplicationBase/Options/VerboseLoggingOption.cs
+26 −5 src/AnakinApps/ApplicationBase/SelfUpdateableAppLifecycle.cs
+3 −0 src/AnakinApps/ApplicationBase/Update/ApplicationUpdateResultHandler.cs
+1 −0 src/AnakinApps/ApplicationBase/Update/ApplicationUpdater.cs
+7 −1 src/AnakinApps/ApplicationBase/Update/CosturaApplicationProductService.cs
+1 −1 src/Updater/AppUpdaterFramework.Manifest/Json/JsonManifestLoader.cs
+1 −1 src/Updater/AppUpdaterFramework/AppUpdaterFramework.csproj
+9 −11 src/Updater/AppUpdaterFramework/Detection/SingleFileDetector.cs
+0 −1 src/Updater/AppUpdaterFramework/External/ExternalUpdaterService.cs
+0 −19 src/Updater/AppUpdaterFramework/FileLocking/ILockingProcessInfo.cs
+2 −2 src/Updater/AppUpdaterFramework/FileLocking/LockingProcessInfo.cs
+8 −8 src/Updater/AppUpdaterFramework/FileLocking/Utilities.cs
+3 −3 src/Updater/AppUpdaterFramework/FileLocking/WindowsLockingProcessManager.cs
+1 −1 src/Updater/AppUpdaterFramework/Handlers/LockedFileHandler.cs
+1 −1 src/Updater/AppUpdaterFramework/Installer/IInstaller.cs
+2 −2 src/Updater/AppUpdaterFramework/Installer/InstallerBase.cs
+0 −4 src/Updater/AppUpdaterFramework/LibraryInitialization.cs
+1 −1 src/Updater/AppUpdaterFramework/Manifest/IManifestLoader.cs
+1 −1 src/Updater/AppUpdaterFramework/Manifest/ManifestFileDownloader.cs
+4 −11 src/Updater/AppUpdaterFramework/Manifest/ManifestInstallationDetector.cs
+1 −1 src/Updater/AppUpdaterFramework/Manifest/ManifestLoaderBase.cs
+1 −1 src/Updater/AppUpdaterFramework/Product/BranchManagerBase.cs
+0 −9 src/Updater/AppUpdaterFramework/Product/Manifest/IManifestInstallationDetector.cs
+2 −3 src/Updater/AppUpdaterFramework/Product/ProductServiceBase.cs
+0 −10 src/Updater/AppUpdaterFramework/Updater/Internal/IUpdateCatalogProvider.cs
+3 −7 src/Updater/AppUpdaterFramework/Updater/Internal/UpdateCatalogFactory.cs
+1 −1 src/Updater/AppUpdaterFramework/Updater/Internal/UpdateService.cs
+1 −1 src/Updater/AppUpdaterFramework/Updater/Progress/ComponentInstallProgressEventArgs.cs
+1 −1 src/Updater/AppUpdaterFramework/Updater/Tasks/InstallStep.cs
6 changes: 3 additions & 3 deletions RawDevTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalUpdater.Core", "Mod
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationBase.CommandLine", "ModdingToolBase\src\AnakinApps\ApplicationBase.CommandLine\ApplicationBase.CommandLine.csproj", "{8768819D-B0C2-4487-3B3A-84A90F36BAB7}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ApplicationBase.Shared", "ModdingToolBase\src\AnakinApps\ApplicationBase.Shared\ApplicationBase.Shared.shproj", "{B297A13A-8E3A-436C-BA97-8B5F57827FFE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppUpdaterFramework.Attributes", "ModdingToolBase\src\Updater\AppUpdaterFramework.Attributes\AppUpdaterFramework.Attributes.csproj", "{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ApplicationBase.Shared", "ModdingToolBase\src\AnakinApps\ApplicationBase.Shared\ApplicationBase.Shared.shproj", "{B297A13A-8E3A-436C-BA97-8B5F57827FFE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -169,8 +169,8 @@ Global
{846253D9-D766-8852-74B9-E1E04B9F2A81} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{EF1942AC-C4E5-A6AA-0328-1DA00E3BE7A1} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{8768819D-B0C2-4487-3B3A-84A90F36BAB7} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
{B297A13A-8E3A-436C-BA97-8B5F57827FFE} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{B297A13A-8E3A-436C-BA97-8B5F57827FFE} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC15751A-BB36-4EF1-BFF0-2DF1E419AC8F}
Expand Down
2 changes: 1 addition & 1 deletion src/DevLauncher.Tests/DevLauncher.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
<PackageReference Include="Testably.Abstractions.Testing" Version="4.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
Expand Down
3 changes: 3 additions & 0 deletions src/DevLauncher/Options/DevToolsOptionBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ internal abstract class DevToolsOptionBase
{
[Option("warnAsError")]
public virtual bool WarnAsError { get; init; }

[Option('v', "verbose", Default = false, HelpText = "Enables verbose logging for this application.")]
public bool VerboseLogging { get; init; }
}
9 changes: 9 additions & 0 deletions src/DevLauncher/Options/VerboseLoggingOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using CommandLine;

namespace RepublicAtWar.DevLauncher.Options;

internal class VerboseLoggingOption
{
[Option('v', "verbose", Default = false, HelpText = "Enables verbose logging for this application.")]
public bool VerboseLogging { get; init; }
}
4 changes: 2 additions & 2 deletions src/DevLauncher/Pipelines/BuildPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private IEnumerable<IStep> CreateBuildSteps()
{
yield return new PackMegFileStep(new RawAiPackMegConfiguration(mod, ServiceProvider), _settings, ServiceProvider);
yield return new PackMegFileStep(new RawCustomMapsPackMegConfiguration(mod, ServiceProvider), _settings, ServiceProvider);
yield return new PackMegFileStep(new RawNonLocalizedSFXMegConfiguration(mod, ServiceProvider), _settings, ServiceProvider);
yield return new PackMegFileStep(new RawNonLocalizedSfxMegConfiguration(mod, ServiceProvider), _settings, ServiceProvider);
yield return new PackIconsStep(_settings, ServiceProvider);
yield return new CompileLocalizationStep(_settings, ServiceProvider);

Expand All @@ -72,7 +72,7 @@ private IEnumerable<IStep> CreateBuildSteps()
continue;

yield return new PackMegFileStep(
new RawLocalizedSFX2DMegConfiguration(focLanguage, isRaWSupported, mod, ServiceProvider),
new RawLocalizedSfx2DMegConfiguration(focLanguage, isRaWSupported, mod, ServiceProvider),
_settings,
ServiceProvider);
}
Expand Down
2 changes: 1 addition & 1 deletion src/DevLauncher/Pipelines/ReleaseRawPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using PG.StarWarsGame.Infrastructure.Games;
using PG.StarWarsGame.Infrastructure.Mods;
using RepublicAtWar.DevLauncher.Utilities;
using RepublicAtWar.DevTools.Steps.Release;
using RepublicAtWar.DevTools.Steps.Releasing;
using RepublicAtWar.DevTools.Steps.Settings;

namespace RepublicAtWar.DevLauncher.Pipelines;
Expand Down
37 changes: 25 additions & 12 deletions src/DevLauncher/Program.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
using AET.ModVerify.Reporting.Reporters;
using AET.SteamAbstraction;
using AnakinRaW.ApplicationBase;
using AnakinRaW.ApplicationBase.Environment;
using AnakinRaW.ApplicationBase.Update;
using AnakinRaW.ApplicationBase.Utilities;
using AnakinRaW.AppUpdaterFramework.Handlers.Interaction;
using AnakinRaW.AppUpdaterFramework.Json;
using AnakinRaW.CommonUtilities.FileSystem;
using AnakinRaW.CommonUtilities.Hashing;
using AnakinRaW.CommonUtilities.Registry;
using AnakinRaW.CommonUtilities.Registry.Windows;
using CommandLine;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PG.Commons;
using PG.StarWarsGame.Engine;
using PG.StarWarsGame.Engine.Xml.Parsers;
using PG.StarWarsGame.Files.ALO;
using PG.StarWarsGame.Files.DAT;
using PG.StarWarsGame.Files.MEG;
using PG.StarWarsGame.Files.MTD;
using PG.StarWarsGame.Files.XML;
using PG.StarWarsGame.Files.XML.Parsers;
using PG.StarWarsGame.Infrastructure;
using PG.StarWarsGame.Infrastructure.Clients.Steam;
using RepublicAtWar.DevLauncher.Options;
using RepublicAtWar.DevLauncher.Services;
using RepublicAtWar.DevLauncher.Update;
using Serilog;
using Serilog.Events;
using Serilog.Filters;
using Serilog.Sinks.SystemConsole.Themes;
using System;
using System.Collections.Generic;
using System.IO.Abstractions;
using System.Reflection;
using System.Threading.Tasks;
using AnakinRaW.ApplicationBase;
using AnakinRaW.ApplicationBase.Environment;
using AnakinRaW.ApplicationBase.Update;
using AnakinRaW.ApplicationBase.Utilities;
using AnakinRaW.AppUpdaterFramework.Json;
using AnakinRaW.CommonUtilities.FileSystem;
using PG.StarWarsGame.Engine.Xml.Parsers;
using PG.StarWarsGame.Files.XML.Parsers;
using RepublicAtWar.DevLauncher.Update;
using Serilog.Sinks.SystemConsole.Themes;
using Testably.Abstractions;
using ILogger = Serilog.ILogger;

Expand Down Expand Up @@ -116,7 +118,15 @@ protected override void ResetApp(Microsoft.Extensions.Logging.ILogger? logger)

protected override void CreateAppServices(IServiceCollection services, IReadOnlyCollection<string> args)
{
services.AddLogging(ConfigureLogging);
var verboseLogging = false;

using var parser = new Parser(s =>
{
s.IgnoreUnknownArguments = true;
});
parser.ParseArguments<VerboseLoggingOption>(args).WithParsed(o => verboseLogging = o.VerboseLogging);

services.AddLogging(builder => ConfigureLogging(builder, verboseLogging));

services.AddSingleton<IHashingService>(sp => new HashingService(sp));

Expand Down Expand Up @@ -144,7 +154,7 @@ protected override void CreateAppServices(IServiceCollection services, IReadOnly
sc => { sc.AddSingleton<ILockedFileInteractionHandler>(new CosturaLockedFileHandler()); });
}

private void ConfigureLogging(ILoggingBuilder loggingBuilder)
private void ConfigureLogging(ILoggingBuilder loggingBuilder, bool verbose)
{
loggingBuilder.ClearProviders();

Expand All @@ -155,6 +165,9 @@ private void ConfigureLogging(ILoggingBuilder loggingBuilder)
loggingBuilder.AddDebug();
#endif

if (verbose)
logLevel = LogEventLevel.Verbose;

var fileLogger = SetupFileLogging(ApplicationEnvironment.ApplicationLocalPath, logLevel);
loggingBuilder.AddSerilog(fileLogger);

Expand Down
2 changes: 1 addition & 1 deletion src/DevLauncher/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Build & Run Mod": {
"commandName": "Project",
"commandLineArgs": "",
"commandLineArgs": "--verboseBootstrapLogging -verbose --skipUpdate",
"workingDirectory": "C:\\Privat\\Steam\\steamapps\\common\\Star Wars Empire at War\\corruption\\Mods\\republic-at-war"
},
"DAT2LocFile": {
Expand Down
12 changes: 6 additions & 6 deletions src/DevLauncher/RawDevLauncher.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using AnakinRaW.ApplicationBase.Environment;
using AnakinRaW.ApplicationBase.Environment;
using AnakinRaW.ApplicationBase.Update.Options;
using AnakinRaW.CommonUtilities.SimplePipeline;
using CommandLine;
Expand All @@ -16,6 +12,10 @@
using RepublicAtWar.DevLauncher.Update;
using RepublicAtWar.DevTools.Services;
using RepublicAtWar.DevTools.Steps.Settings;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace RepublicAtWar.DevLauncher;

Expand All @@ -36,7 +36,7 @@ public async Task<int> RunAsync(IReadOnlyList<string> args)

return await RunCore(option).ConfigureAwait(false);
}

private async Task UpdateLauncher(IReadOnlyList<string> args)
{
var skipUpdate = false;
Expand Down
2 changes: 1 addition & 1 deletion src/MegCompile/PackSfxMegPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override Task<IList<IStep>> BuildSteps()
continue;

steps.Add(new PackMegFileStep(
new RawLocalizedSFX2DMegConfiguration(focLanguage, isRaWSupported, mod, ServiceProvider), settings,
new RawLocalizedSfx2DMegConfiguration(focLanguage, isRaWSupported, mod, ServiceProvider), settings,
ServiceProvider));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Abstractions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PG.StarWarsGame.Engine;
Expand All @@ -10,7 +9,7 @@

namespace RepublicAtWar.DevTools.Steps.Build.Meg.Config;

public sealed class RawLocalizedSFX2DMegConfiguration : RawPackMegConfiguration
public sealed class RawLocalizedSfx2DMegConfiguration : RawPackMegConfiguration
{
private readonly Lazy<Func<string, string>?> _lazyLocalizeFileName;
private readonly LanguageType _language;
Expand All @@ -26,7 +25,8 @@ public sealed class RawLocalizedSFX2DMegConfiguration : RawPackMegConfiguration

public override bool FileNamesOnly => true;

public RawLocalizedSFX2DMegConfiguration(LanguageType language,
public RawLocalizedSfx2DMegConfiguration(
LanguageType language,
bool languageSupported,
IPhysicalPlayableObject physicalGameObject,
IServiceProvider serviceProvider) : base(physicalGameObject, serviceProvider)
Expand All @@ -47,11 +47,9 @@ public RawLocalizedSFX2DMegConfiguration(LanguageType language,

private IEnumerable<string> GetFilesToPack()
{
var fs = ServiceProvider.GetRequiredService<IFileSystem>();
var path = FileSystem.Path.Combine("Data\\Audio\\Units\\", _language.ToString());

var path = fs.Path.Combine("Data\\Audio\\Units\\", _language.ToString());

if (!fs.Directory.Exists(path))
if (!FileSystem.Directory.Exists(path))
{
if (IsLanguageSupported)
throw new DirectoryNotFoundException($"Unable to find SFX directory: '{path}'");
Expand All @@ -60,7 +58,7 @@ private IEnumerable<string> GetFilesToPack()
path = $"Data\\Audio\\Units\\{LanguageType.English}";
}

if (!fs.Directory.Exists(path))
if (!FileSystem.Directory.Exists(path))
throw new DirectoryNotFoundException($"Unable to find SFX directory: '{path}'");

return new List<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace RepublicAtWar.DevTools.Steps.Build.Meg.Config;

public class RawNonLocalizedSFXMegConfiguration(
public class RawNonLocalizedSfxMegConfiguration(
IPhysicalPlayableObject physicalGameObject,
IServiceProvider serviceProvider)
: RawPackMegConfiguration(physicalGameObject, serviceProvider)
Expand Down
23 changes: 11 additions & 12 deletions src/RawDevTools/Steps/Build/Meg/Config/RawPackMegConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ namespace RepublicAtWar.DevTools.Steps.Build.Meg.Config;

public abstract class RawPackMegConfiguration : IPackMegConfiguration
{
protected ILogger? Logger { get; }
protected readonly ILogger? Logger;
protected readonly IFileSystem FileSystem;
protected readonly IServiceProvider ServiceProvider;

protected IServiceProvider ServiceProvider { get; }
public abstract IEnumerable<string> FilesToPack { get; }

protected readonly IFileSystem FileSystem;
public abstract string FileName { get; }

public virtual bool FileNamesOnly => false;

public IDirectoryInfo VirtualRootDirectory { get; }

public virtual Func<string, string>? ModifyFileNameAction => null;

protected RawPackMegConfiguration(IPhysicalPlayableObject physicalGameObject,
IServiceProvider serviceProvider)
Expand All @@ -23,13 +31,4 @@ protected RawPackMegConfiguration(IPhysicalPlayableObject physicalGameObject,
FileSystem = serviceProvider.GetRequiredService<IFileSystem>();
VirtualRootDirectory = physicalGameObject.Directory;
}

public abstract IEnumerable<string> FilesToPack { get; }

public abstract string FileName { get; }

public virtual bool FileNamesOnly => false;

public IDirectoryInfo VirtualRootDirectory { get; }
public virtual Func<string, string>? ModifyFileNameAction => null;
}
2 changes: 1 addition & 1 deletion src/RawDevTools/Steps/Releasing/CopyReleaseStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Microsoft.Extensions.Logging;
using RepublicAtWar.DevTools.Steps.Settings;

namespace RepublicAtWar.DevTools.Steps.Release;
namespace RepublicAtWar.DevTools.Steps.Releasing;

public class CopyReleaseStep : PipelineStep, IProgressStep
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.Extensions.Logging;
using Semver;

namespace RepublicAtWar.DevTools.Steps.Release;
namespace RepublicAtWar.DevTools.Steps.Releasing;

public class CreateUploadMetaArtifactsStep(IServiceProvider serviceProvider) : SynchronizedStep(serviceProvider)
{
Expand All @@ -19,9 +19,9 @@ public class CreateUploadMetaArtifactsStep(IServiceProvider serviceProvider) : S

private readonly IDictionary<string, string> _replacementVariables = new Dictionary<string, string>();

internal string? SteamTitle { get; private set; }
internal string SteamTitle { get; private set; } = null!;

internal string? SteamJsonName { get; private set; }
internal string SteamJsonName { get; private set; } = null!;

protected override void RunSynchronized(CancellationToken token)
{
Expand Down
Loading