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 ModVerify
2 changes: 1 addition & 1 deletion ModdingToolBase
Submodule ModdingToolBase updated 132 files
14 changes: 7 additions & 7 deletions RawDevTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AnakinApps", "AnakinApps",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppUpdaterFramework.Manifest", "ModdingToolBase\src\Updater\AppUpdaterFramework.Manifest\AppUpdaterFramework.Manifest.csproj", "{40EDE817-AA59-4F6D-A9E1-A26D2F65FE85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppUpdaterFramework.Core", "ModdingToolBase\src\Updater\AppUpdaterFramework.Core\AppUpdaterFramework.Core.csproj", "{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppUpdaterFramework", "ModdingToolBase\src\Updater\AppUpdaterFramework\AppUpdaterFramework.csproj", "{61E8C035-B71E-4F93-8D3A-DBCCEDE83A52}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationBase", "ModdingToolBase\src\AnakinApps\ApplicationBase\ApplicationBase.csproj", "{9F2A24AE-04E9-4CB0-825E-FE6A7BD25614}"
Expand Down Expand Up @@ -59,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationBase.CommandLine
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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -73,10 +73,6 @@ Global
{40EDE817-AA59-4F6D-A9E1-A26D2F65FE85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40EDE817-AA59-4F6D-A9E1-A26D2F65FE85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40EDE817-AA59-4F6D-A9E1-A26D2F65FE85}.Release|Any CPU.Build.0 = Release|Any CPU
{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9}.Release|Any CPU.Build.0 = Release|Any CPU
{61E8C035-B71E-4F93-8D3A-DBCCEDE83A52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61E8C035-B71E-4F93-8D3A-DBCCEDE83A52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61E8C035-B71E-4F93-8D3A-DBCCEDE83A52}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -145,13 +141,16 @@ Global
{8768819D-B0C2-4487-3B3A-84A90F36BAB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8768819D-B0C2-4487-3B3A-84A90F36BAB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8768819D-B0C2-4487-3B3A-84A90F36BAB7}.Release|Any CPU.Build.0 = Release|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AA3A6D5-5492-26C3-E36C-54AB5997D2CF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{40EDE817-AA59-4F6D-A9E1-A26D2F65FE85} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{31463AD9-1BDC-40BA-A192-02F9CFE9BDB9} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{61E8C035-B71E-4F93-8D3A-DBCCEDE83A52} = {3E986062-E81F-4833-A127-24FA73FBCB1B}
{9F2A24AE-04E9-4CB0-825E-FE6A7BD25614} = {46DB413A-0F73-48A6-9071-9C38916BE6FC}
{FBC72463-9948-4030-B67D-BDC8C27E11C9} = {266B0025-20CE-4A57-94DF-ABFAB21189AD}
Expand All @@ -171,6 +170,7 @@ Global
{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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DC15751A-BB36-4EF1-BFF0-2DF1E419AC8F}
Expand Down
53 changes: 27 additions & 26 deletions src/DevLauncher.Tests/DevLauncher.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="Testably.Abstractions.Testing" Version="4.0.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.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" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DevLauncher\DevLauncher.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RawDevTools\RawDevTools.csproj" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

</Project>
18 changes: 9 additions & 9 deletions src/DevLauncher/DevLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
<PackageReference Include="AnakinRaW.CommonUtilities.SimplePipeline" Version="12.3.8" />
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.13.1" />
<PackageReference Include="Antlr4BuildTasks" Version="12.10.0" />
<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="AnakinRaW.CommonUtilities.Registry" Version="12.3.8" />
<PackageReference Include="Glob" Version="1.1.9" />
<PackageReference Include="IsExternalInit" Version="1.0.3">
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />

<PackageReference Include="Costura.Fody" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
<PackageReference Include="Required" Version="1.0.0">
</ItemGroup>

<ItemGroup>
<PackageReference Include="IndexRange" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="IndexRange" Version="1.0.3" Condition="$(TargetFramework) == 'net481'">
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/DevLauncher/Options/ReleaseRepublicAtWarOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ internal sealed class ReleaseRepublicAtWarOption : RaWBuildOption
public override bool WarnAsError { get; init; } = true;

[Option("uploaderDir", Required = true)]
public string UploaderDirectory { get; init; }
public required string UploaderDirectory { get; init; }
}
20 changes: 2 additions & 18 deletions src/DevLauncher/Pipelines/Actions/CreateLocalizationDiffsAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System.IO.Abstractions;
using System.Linq;
using System.Threading;
using RepublicAtWar.DevLauncher.Utilities;
using AnakinRaW.ApplicationBase;

namespace RepublicAtWar.DevLauncher.Pipelines.Actions;

Expand Down Expand Up @@ -173,23 +173,7 @@ private void ManuallyChooseDiffedText(ICollection<(DatStringEntry baseEntry, str
CompuMaster.Text.Diffs.DumpDiffToConsole(newText, oldText, true);
Console.WriteLine();


var keepEntry = ConsoleUtilities.UserQuestionOnSameLine("Keep? [y/n]: ", (string input, out bool keep) =>
{
if (input.Equals("y", StringComparison.OrdinalIgnoreCase))
{
keep = true;
return true;
}
if (input.Equals("n", StringComparison.OrdinalIgnoreCase))
{
keep = false;
return true;
}

keep = false;
return false;
});
var keepEntry = ConsoleUtilities.UserYesNoQuestion("Keep?");

diffFile.Add(key, keepEntry ? TempDiffEntriesFile.DiffAction.Keep : TempDiffEntriesFile.DiffAction.Ignore);
if (!keepEntry)
Expand Down
32 changes: 29 additions & 3 deletions src/DevLauncher/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using AET.ModVerify.Reporting.Reporters;
using AET.SteamAbstraction;
using AnakinRaW.AppUpdaterFramework;
using AnakinRaW.AppUpdaterFramework.Handlers.Interaction;
using AnakinRaW.CommonUtilities.Hashing;
using AnakinRaW.CommonUtilities.Registry;
Expand Down Expand Up @@ -29,6 +28,7 @@
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;
Expand Down Expand Up @@ -75,7 +75,34 @@ protected override async Task<int> RunAppAsync(string[] args, IServiceProvider a
{
using (new UnhandledExceptionHandler(appServiceProvider))
using (new UnobservedTaskExceptionHandler(appServiceProvider))
return await new RawDevLauncher(UpdatableApplicationEnvironment!, appServiceProvider).RunAsync(args);
return await RunAppCoreAsync(args, appServiceProvider).ConfigureAwait(false);
}

private async Task<int> RunAppCoreAsync(string[] args, IServiceProvider appServiceProvider)
{
var logger = appServiceProvider.GetService<ILoggerFactory>()?.CreateLogger(GetType());
try
{
var returnCode = await new RawDevLauncher(UpdatableApplicationEnvironment!, appServiceProvider)
.RunAsync(args);
logger?.LogInformation($"RaW DevLauncher finished with code: {returnCode}");
return returnCode;
}
catch (Exception e)
{
ConsoleUtilities.WriteApplicationFatalError(ApplicationEnvironment.ApplicationName);
logger?.LogError(e, e.Message);
return e.HResult;
}
finally
{
Log.CloseAndFlush();

Console.WriteLine();
ConsoleUtilities.WriteHorizontalLine('-');
Console.Write("Press ENTER to exit.");
Console.ReadLine();
}
}

protected override void ResetApp(Microsoft.Extensions.Logging.ILogger? logger)
Expand Down Expand Up @@ -150,7 +177,6 @@ private void ConfigureLogging(ILoggingBuilder loggingBuilder)
return false;

return true;

})
.MinimumLevel.Is(logLevel)
.CreateLogger();
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 @@ -28,7 +28,7 @@
"Build & Verify Republic at War": {
"commandName": "Project",
"commandLineArgs": "verify --skipUpdate",
"workingDirectory": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Star Wars Empire at War\\corruption\\Mods\\Republic_at_War"
"workingDirectory": "C:\\Privat\\Steam\\steamapps\\common\\Star Wars Empire at War\\corruption\\Mods\\republic-at-war"
}
}
}
46 changes: 26 additions & 20 deletions src/DevLauncher/RawDevLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ internal sealed class RawDevLauncher(UpdatableApplicationEnvironment application

public async Task<int> RunAsync(IReadOnlyList<string> args)
{
_logger?.LogDebug("Command line arguments: " + string.Join(" ", args));
var option = ParseArguments(args);

if (option is null)
return 0xA0;

await UpdateLauncher(args).ConfigureAwait(false);

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

private async Task UpdateLauncher(IReadOnlyList<string> args)
{
var skipUpdate = false;
_looseArgumentParser.ParseArguments<SkipUpdateOption>(args).WithParsed(su => skipUpdate = su.SkipUpdate);

Expand All @@ -39,40 +49,36 @@ public async Task<int> RunAsync(IReadOnlyList<string> args)
_looseArgumentParser.ParseArguments<ApplicationUpdateOptions>(args).WithParsed(updateOptions => options = updateOptions);

var updater = new RawDevLauncherUpdater(applicationEnvironment, serviceProvider);
var branch = updater.CreateBranch(options?.BranchName, options?.ManifestUrl);
var branchName = updater.GetBranchNameFromRegistry(options?.BranchName, true);
var branch = updater.CreateBranch(branchName, options?.ManifestUrl);

await updater.AutoUpdateApplication(branch);
}
else
{
_logger?.LogDebug("Skipping update routine.");
}
}

private DevToolsOptionBase? ParseArguments(IReadOnlyList<string> args)
{
Type[] optionTypes =
[
typeof(BuildAndRunOption),
typeof(InitializeLocalizationOption),
typeof(PrepareLocalizationsOption),
typeof(MergeLocalizationOption),
typeof(ReleaseRepublicAtWarOption),
typeof(VerifyOption)
typeof(InitializeLocalizationOption),
typeof(PrepareLocalizationsOption),
typeof(MergeLocalizationOption),
typeof(ReleaseRepublicAtWarOption),
typeof(VerifyOption)
];

var toolResult = 0;
var parseResult = _looseArgumentParser.ParseArguments(args, optionTypes);

await parseResult.WithParsedAsync(async o =>
{
toolResult = await RunCore((DevToolsOptionBase)o);
});

await parseResult.WithNotParsedAsync(_ =>
{
Console.WriteLine(HelpText.AutoBuild(parseResult).ToString());
toolResult = 0xA0;
return Task.CompletedTask;
});
if (parseResult.Value is DevToolsOptionBase devToolsOption)
return devToolsOption;

return toolResult;
Console.WriteLine(HelpText.AutoBuild(parseResult).ToString());
return null;
}

private async Task<int> RunCore(DevToolsOptionBase options)
Expand Down
Loading
Loading