Skip to content

Commit

Permalink
Merge branch 'dev' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Sep 21, 2024
2 parents 9a58888 + 8214b69 commit f48dcb7
Show file tree
Hide file tree
Showing 52 changed files with 842 additions and 245 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
- uses: actions/checkout@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.102
dotnet-version: 8.0.*
- name: Install dependencies
run: dotnet restore Synthesis.Bethesda.sln
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
- uses: actions/checkout@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.102
dotnet-version: 8.0.*
- name: Install dependencies
run: dotnet restore Synthesis.Bethesda.sln
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
- uses: actions/checkout@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.102
dotnet-version: 8.0.*
- name: Install dependencies
run: |
dotnet clean Synthesis.Bethesda.sln -c Release && dotnet nuget locals all --clear
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Platforms>x64</Platforms>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
</PropertyGroup>
Expand Down
108 changes: 66 additions & 42 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<PackageVersion Include="Autofac">
<Version>8.0.0</Version>
</PackageVersion>
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection">
<Version>9.0.0</Version>
</PackageVersion>
<PackageVersion Include="AutoFixture">
<Version>4.18.1</Version>
</PackageVersion>
Expand All @@ -15,120 +17,142 @@
<Version>6.12.0</Version>
</PackageVersion>
<PackageVersion Include="GitHubDependents" Version="1.2.0" />
<PackageVersion Include="GitInfo">
<Version>3.3.4</Version>
<PrivateAssets>all</PrivateAssets>
<PackageVersion Include="GitInfo" PrivateAssets="all">
<Version>3.3.5</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
<PackageVersion Include="LibGit2Sharp" Version="0.26.2" />
<PackageVersion Include="LibGit2Sharp">
<Version>0.30.0</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.Build">
<Version>17.7.2</Version>
<Version>17.10.4</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.Build.Tasks.Core">
<Version>17.7.2</Version>
<Version>17.10.4</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis">
<Version>4.10.0</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis">
<Version>4.9.2</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.SourceGenerators.Testing" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.SourceGenerators.Testing" Version="1.1.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
<Version>4.9.2</Version>
<Version>4.10.0</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild">
<Version>4.9.2</Version>
<Version>4.10.0</Version>
</PackageVersion>
<PackageVersion Include="Microsoft.NET.Test.Sdk">
<Version>17.9.0</Version>
<Version>17.10.0</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Autofac">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Core">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Json">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Kernel">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.Testing">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Mutagen.Bethesda.WPF">
<Version>0.45.1</Version>
<Version>0.46</Version>
</PackageVersion>
<PackageVersion Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageVersion>
<PackageVersion Include="Noggog.Autofac">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.CSharpExt">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.CSharpExt.Json">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.CSharpExt.Windows">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.GitRepository">
<Version>1.2</Version>
</PackageVersion>
<PackageVersion Include="Noggog.SourceGenerators">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.Testing">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="Noggog.WPF">
<Version>2.65.0-nightly-20240521-192763</Version>
<Version>2.65.1-nightly-20240911-092507</Version>
</PackageVersion>
<PackageVersion Include="NSubstitute">
<Version>5.1.0</Version>
</PackageVersion>
<PackageVersion Include="NuGet.Versioning">
<Version>6.7.0</Version>
<Version>6.10.1</Version>
</PackageVersion>
<PackageVersion Include="NuGetizer">
<Version>1.2.1</Version>
<Version>1.2.2</Version>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="ReactiveUI">
<Version>19.5.41</Version>
<Version>20.1.1</Version>
</PackageVersion>
<PackageVersion Include="ReactiveUI.Fody">
<Version>19.5.41</Version>
</PackageVersion>
<PackageVersion Include="ReactiveUI.WPF">
<Version>19.5.41</Version>
<Version>20.1.1</Version>
</PackageVersion>
<PackageVersion Include="Serilog">
<Version>4.0.1</Version>
</PackageVersion>
<PackageVersion Include="Serilog.Enrichers.Thread">
<Version>4.0.0</Version>
</PackageVersion>
<PackageVersion Include="Serilog.Extensions.Logging">
<Version>8.0.0</Version>
</PackageVersion>
<PackageVersion Include="Serilog.Sinks.Console">
<Version>6.0.0</Version>
</PackageVersion>
<PackageVersion Include="Serilog.Sinks.File">
<Version>6.0.0</Version>
</PackageVersion>
<PackageVersion Include="Serilog.Sinks.Map">
<Version>2.0.0</Version>
</PackageVersion>
<PackageVersion Include="StrongInject">
<Version>1.4.4</Version>
</PackageVersion>
<PackageVersion Include="Serilog" Version="2.12.0" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageVersion Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Reactive">
<Version>6.0.0</Version>
<Version>6.0.1</Version>
</PackageVersion>
<PackageVersion Include="xunit">
<Version>2.6.1</Version>
<Version>2.9.0</Version>
</PackageVersion>
<PackageVersion Include="xunit.runner.visualstudio">
<Version>2.5.3</Version>
<Version>2.8.2</Version>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Verify.Xunit">
<Version>26.1.5</Version>
</PackageVersion>
<PackageVersion Include="Verify.DiffPlex">
<Version>3.1.0</Version>
</PackageVersion>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions Mutagen.Bethesda.Synthesis.WPF/Resources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@
<Style x:Key="NoggogNumericUpDown" TargetType="{x:Type xwpf:InputBase}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static xwpfThemes:ResourceKeys.ControlNormalBorderKey}}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Right" />
<Setter Property="IsTabStop" Value="False" />
Expand Down Expand Up @@ -668,7 +668,7 @@

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlMouseOverBorderKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static xwpfThemes:ResourceKeys.ControlMouseOverBorderKey}}" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
Expand All @@ -681,7 +681,7 @@
<Setter TargetName="PART_TextBox" Property="IsReadOnly" Value="True" />
</DataTrigger>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:ResourceKeys.ControlSelectedBorderKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static xwpfThemes:ResourceKeys.ControlSelectedBorderKey}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
Expand Down
13 changes: 9 additions & 4 deletions Mutagen.Bethesda.Synthesis/Pipeline/SynthesisPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,21 +588,26 @@ private async Task Run(
var prefs = patcher.Prefs ?? new PatcherPreferences();
var gameReleaseInjection = new GameReleaseInjection(args.GameRelease);
var categoryContext = new GameCategoryContext(gameReleaseInjection);
var dataDir = new DataDirectoryInjection(args.DataFolderPath);
var gameLoc = new GameLocator();
var stateFactory = new PatcherStateFactory(
fileSystem,
new LoadOrderImporterFactory(
fileSystem),
fileSystem,
new MasterFlagsLookupProvider(
gameReleaseInjection,
fileSystem,
dataDir)),
new GetStateLoadOrder(
new ImplicitListingsProvider(
fileSystem,
new DataDirectoryInjection(args.DataFolderPath),
dataDir,
new ImplicitListingModKeyProvider(
gameReleaseInjection)),
new OrderListings(),
new CreationClubListingsProvider(
fileSystem,
new DataDirectoryInjection(args.DataFolderPath),
dataDir,
new CreationClubListingsPathProvider(
categoryContext,
new CreationClubEnabledProvider(categoryContext),
Expand Down Expand Up @@ -636,8 +641,8 @@ private async Task Run(
try
{
await state.PatchMod.BeginWrite
.WithLoadOrder(state.LoadOrderForPipeline)
.ToPath(args.OutputPath)
.WithLoadOrder(state.LoadOrderForPipeline)
.WithFileSystem(fileSystem)
.NoModKeySync()
.WithTargetLanguage(args.TargetLanguage)
Expand Down
2 changes: 1 addition & 1 deletion Mutagen.Bethesda.Synthesis/Projects/CreateProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public string[] Create(
sb.AppendLine("<Project Sdk=\"Microsoft.NET.Sdk\">");
sb.AppendLine($" <PropertyGroup>");
sb.AppendLine($" <OutputType>Exe</OutputType>");
sb.AppendLine($" <TargetFramework>{(targetFramework ?? "net6.0")}</TargetFramework>");
sb.AppendLine($" <TargetFramework>{(targetFramework ?? "net8.0")}</TargetFramework>");
sb.AppendLine($" <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>");
sb.AppendLine($" <ImplicitUsings>true</ImplicitUsings>");
sb.AppendLine($" </PropertyGroup>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ ILoadOrderImporter<TModGetter> Get<TModGetter> (
public class LoadOrderImporterFactory : ILoadOrderImporterFactory
{
private readonly IFileSystem _FileSystem;
private readonly IMasterFlagsLookupProvider _masterFlagsLookupProvider;

public LoadOrderImporterFactory(IFileSystem fileSystem)
public LoadOrderImporterFactory(
IFileSystem fileSystem,
IMasterFlagsLookupProvider masterFlagsLookupProvider)
{
_FileSystem = fileSystem;
_masterFlagsLookupProvider = masterFlagsLookupProvider;
}

public ILoadOrderImporter<TModGetter> Get<TModGetter>(
Expand All @@ -37,6 +41,7 @@ public ILoadOrderImporter<TModGetter> Get<TModGetter>(
new LoadOrderListingsInjection(listings),
new ModImporter<TModGetter>(
_FileSystem,
new GameReleaseInjection(release)));
new GameReleaseInjection(release)),
_masterFlagsLookupProvider);
}
}
21 changes: 18 additions & 3 deletions Mutagen.Bethesda.Synthesis/States/DI/PatcherStateFactory.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.IO.Abstractions;
using Mutagen.Bethesda.Plugins;
using Mutagen.Bethesda.Plugins.Allocators;
using Mutagen.Bethesda.Plugins.Binary.Headers;
using Mutagen.Bethesda.Plugins.Binary.Parameters;
using Mutagen.Bethesda.Plugins.Cache;
using Mutagen.Bethesda.Plugins.Meta;
using Mutagen.Bethesda.Plugins.Order;
using Mutagen.Bethesda.Plugins.Records;
using Mutagen.Bethesda.Plugins.Records.Internals;
Expand Down Expand Up @@ -111,16 +113,29 @@ public SynthesisState<TModSetter, TModGetter> ToState<TModSetter, TModGetter>(Ru
}
else
{
// ToDo
// Eventually use generic read builder
Cache<IModMasterStyledGetter, ModKey>? masterFlagsLookup = null;
if (GameConstants.Get(settings.GameRelease).SeparateMasterLoadOrders)
{
var header = ModHeaderFrame.FromPath(settings.SourcePath, settings.GameRelease, _fileSystem);
masterFlagsLookup = new Cache<IModMasterStyledGetter, ModKey>(x => x.ModKey);
foreach (var master in header.Masters(exportKey).Select(x => x.Master))
{
var otherPath = Path.Combine(settings.DataFolderPath, master.FileName);
var otherHeader = ModHeaderFrame.FromPath(otherPath, settings.GameRelease, _fileSystem);
masterFlagsLookup.Add(new KeyedMasterStyle(master, otherHeader.MasterStyle));
}
}

readOnlyPatchMod = ModInstantiator<TModGetter>.Importer(
new ModPath(exportKey, settings.SourcePath),
settings.GameRelease,
new BinaryReadParameters()
{
FileSystem = _fileSystem,
StringsParam = stringReadParams,
LoadOrder = new LoadOrder<IModFlagsGetter>(
loadOrder.Select(x => x.Value.Mod)
.NotNull())
MasterFlagsLookup = masterFlagsLookup
});
}
loadOrder.Add(new ModListing<TModGetter>(readOnlyPatchMod, enabled: true));
Expand Down
Loading

0 comments on commit f48dcb7

Please sign in to comment.