Skip to content

Commit

Permalink
Merge branch 'pre-release' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Aug 22, 2021
2 parents cdf4551 + aa14dd2 commit e765ef1
Show file tree
Hide file tree
Showing 59 changed files with 405 additions and 350 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mutagen.Bethesda.WPF" Version="0.30.4" />
<PackageReference Include="NuGetizer" Version="0.7.0">
<PackageReference Include="Mutagen.Bethesda.WPF" Version="0.31.0" />
<PackageReference Include="NuGetizer" Version="0.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="reactiveui" Version="13.3.2" />
<PackageReference Include="ReactiveUI.Fody" Version="13.3.2" />
<PackageReference Include="reactiveui" Version="14.3.10" />
<PackageReference Include="ReactiveUI.Fody" Version="14.3.10" />
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
</ItemGroup>

Expand Down
18 changes: 14 additions & 4 deletions Mutagen.Bethesda.Synthesis.WPF/ReflectionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,24 @@ public static async Task<GetResponse<(TRet Item, TempFolder Temp)>> ExtractInfoF
CopyDirectory(projDir, tempFolder.Dir.Path, cancel);
projPath = Path.Combine(tempFolder.Dir.Path, Path.GetFileName(projPath));
log($"Retrieving executable path from {projPath}");
var exec = await DotNetCommands.GetExecutablePath(projPath, cancel, log);
if (exec.Failed) return exec.BubbleFailure<(TRet Item, TempFolder Temp)>();
log($"Located executable path for {projPath}: {exec.Value}");
var ret = ExecuteAndUnload(exec.Value, getter);
var execResp = await DotNetCommands.GetExecutablePath(projPath, cancel, log);
if (execResp.Failed) return execResp.BubbleFailure<(TRet Item, TempFolder Temp)>();
var exec = CorrectUserFolder(execResp.Value, Path.GetTempPath());
log($"Located executable path for {projPath}: {exec}");
var ret = ExecuteAndUnload(exec, getter);
if (ret.Failed) return ret.BubbleFailure<(TRet Item, TempFolder Temp)>();
return (ret.Value, tempFolder);
}

public static string CorrectUserFolder(string execPath, string tempFolder)
{
if (File.Exists(execPath)) return execPath;
const string delimiter = "AppData\\Local\\Temp";
if (!execPath.ContainsInsensitive(delimiter)) return execPath;
var trim = execPath.Substring(execPath.IndexOf(delimiter) + delimiter.Length + 1);
return Path.Combine(tempFolder, trim);
}

private static GetResponse<TRet> ExecuteAndUnload<TRet>(string exec, Func<Assembly, GetResponse<TRet>> getter)
{
return AssemblyLoading.ExecuteAndForceUnload(exec, getter, () => new FormKeyAssemblyLoadContext(exec));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@ public AutogeneratedSettingsView()
{
this.WhenAnyFallback(x => x.ViewModel!.SettingsLoading)
.Select(x => x ? Visibility.Visible : Visibility.Collapsed)
.BindToStrict(this, x => x.ProcessingRingGrid.Visibility)
.BindTo(this, x => x.ProcessingRingGrid.Visibility)
.DisposeWith(disposable);
this.WhenAnyFallback(x => x.ViewModel!.SettingsLoading)
.Select(x => x ? Visibility.Visible : Visibility.Collapsed)
.BindToStrict(this, x => x.ProcessingRing.Visibility)
.BindTo(this, x => x.ProcessingRing.Visibility)
.DisposeWith(disposable);
this.WhenAnyFallback(x => x.ViewModel!.Bundle!.Settings)
.BindToStrict(this, x => x.ReflectionSettingTabs.ItemsSource)
.BindTo(this, x => x.ReflectionSettingTabs.ItemsSource)
.DisposeWith(disposable);
this.WhenAnyFallback(x => x.ViewModel!.Bundle!.Settings!.Count)
.Select(x => x > 0 ? Visibility.Visible : Visibility.Collapsed)
.BindToStrict(this, x => x.ReflectionSettingTabs.Visibility)
.BindTo(this, x => x.ReflectionSettingTabs.Visibility)
.DisposeWith(disposable);
this.BindStrict(this.ViewModel, vm => vm.SelectedSettings, view => view.ReflectionSettingTabs.SelectedItem)
this.Bind(this.ViewModel, vm => vm.SelectedSettings, view => view.ReflectionSettingTabs.SelectedItem)
.DisposeWith(disposable);
Observable.CombineLatest(
this.WhenAnyFallback(x => x.ViewModel!.Error),
this.WhenAnyFallback(x => x.ViewModel!.SettingsLoading),
(err, loading) => !loading && err.Failed)
.Select(failed => failed ? Visibility.Visible : Visibility.Collapsed)
.BindToStrict(this, x => x.ErrorPanel.Visibility)
.BindTo(this, x => x.ErrorPanel.Visibility)
.DisposeWith(disposable);
this.WhenAnyFallback(x => x.ViewModel!.Error.Reason)
.BindToStrict(this, x => x.ErrorBox.Text)
.BindTo(this, x => x.ErrorBox.Text)
.DisposeWith(disposable);
});
}
Expand Down
8 changes: 5 additions & 3 deletions Mutagen.Bethesda.Synthesis/Internal/InternalUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Mutagen.Bethesda.Plugins.Masters;

namespace Mutagen.Bethesda.Synthesis.Internal
{
Expand Down Expand Up @@ -146,8 +147,7 @@ public static IPatcherState ToState(GameCategory category, RunSynthesisMutagenPa
var regis = category.ToModRegistration();
var method = typeof(Utility).GetMethods()
.Where(m => m.Name == nameof(ToState))
.Where(m => m.ContainsGenericParameters)
.First()
.First(m => m.ContainsGenericParameters)
.MakeGenericMethod(regis.SetterType, regis.GetterType);
return (IPatcherState)method.Invoke(null, new object[]
{
Expand All @@ -162,7 +162,9 @@ public static void AddImplicitMasters(RunSynthesisMutagenPatcher settings, IList
HashSet<ModKey> referencedMasters = new();
foreach (var item in loadOrderListing.OnlyEnabled())
{
MasterReferenceReader reader = MasterReferenceReader.FromPath(Path.Combine(settings.DataFolderPath, item.ModKey.FileName), settings.GameRelease);
var path = Path.Combine(settings.DataFolderPath, item.ModKey.FileName);
if (!File.Exists(Path.Combine(settings.DataFolderPath, item.ModKey.FileName))) continue;
MasterReferenceReader reader = MasterReferenceReader.FromPath(path, settings.GameRelease);
referencedMasters.Add(reader.Masters.Select(m => m.Master));
}
for (int i = 0; i < loadOrderListing.Count; i++)
Expand Down
14 changes: 7 additions & 7 deletions Mutagen.Bethesda.Synthesis/Mutagen.Bethesda.Synthesis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mutagen.Bethesda" Version="0.30.4" />
<PackageReference Include="Mutagen.Bethesda.Core.Windows" Version="0.30.4" />
<PackageReference Include="Mutagen.Bethesda.Json" Version="0.30.4" />
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.30.4" />
<PackageReference Include="Mutagen.Bethesda.Sqlite" Version="0.30.4" />
<PackageReference Include="Mutagen.Bethesda" Version="0.31.0" />
<PackageReference Include="Mutagen.Bethesda.Core.Windows" Version="0.31.0" />
<PackageReference Include="Mutagen.Bethesda.Json" Version="0.31.0" />
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.31.0" />
<PackageReference Include="Mutagen.Bethesda.Sqlite" Version="0.31.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Noggog.CSharpExt" Version="2.21.0" />
<PackageReference Include="NuGetizer" Version="0.7.0">
<PackageReference Include="Noggog.CSharpExt" Version="2.27.0" />
<PackageReference Include="NuGetizer" Version="0.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
1 change: 1 addition & 0 deletions Mutagen.Bethesda.Synthesis/States/IRunnabilityState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Noggog;
using Synthesis.Bethesda;
using System.ComponentModel;
using Mutagen.Bethesda.Environments;

namespace Mutagen.Bethesda.Synthesis
{
Expand Down
5 changes: 3 additions & 2 deletions Mutagen.Bethesda.Synthesis/States/RunnabilityState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Mutagen.Bethesda.Plugins.Records;
using Noggog;
using Synthesis.Bethesda;
using System.Collections.Generic;
using Mutagen.Bethesda.Environments;

namespace Mutagen.Bethesda.Synthesis
{
Expand Down Expand Up @@ -41,9 +41,10 @@ public class RunnabilityState : IRunnabilityState
{
var lo = Plugins.Order.LoadOrder.Import<TModGetter>(DataFolderPath, LoadOrder.ListedOrder, GameRelease);
return new GameEnvironmentState<TModSetter, TModGetter>(
gameRelease: Settings.GameRelease,
dataFolderPath: DataFolderPath,
loadOrderFilePath: LoadOrderFilePath,
creationKitLoadOrderFilePath: null,
creationClubListingsFilePath: null,
loadOrder: lo,
linkCache: lo.ToImmutableLinkCache<TModSetter, TModGetter>());
}
Expand Down
5 changes: 3 additions & 2 deletions Mutagen.Bethesda.Synthesis/SynthesisPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Text.Json;
using System.Threading.Tasks;
using Mutagen.Bethesda.Installs;
using Mutagen.Bethesda.Plugins.Binary.Parameters;
using SynthesisBase = Synthesis.Bethesda;

namespace Mutagen.Bethesda.Synthesis
Expand Down Expand Up @@ -591,8 +592,8 @@ private BinaryWriteParameters GetWriteParams(IEnumerable<ModKey> loadOrder)
{
return new BinaryWriteParameters()
{
ModKey = BinaryWriteParameters.ModKeyOption.NoCheck,
MastersListOrdering = new BinaryWriteParameters.MastersListOrderingByLoadOrder(loadOrder),
ModKey = ModKeyOption.NoCheck,
MastersListOrdering = new MastersListOrderingByLoadOrder(loadOrder),
};
}

Expand Down
2 changes: 1 addition & 1 deletion Synthesis.Bethesda.CLI/Synthesis.Bethesda.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NuGetizer" Version="0.7.0">
<PackageReference Include="NuGetizer" Version="0.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 3 additions & 1 deletion Synthesis.Bethesda.Execution/DotNetCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ public static async Task<GetResponse<string>> GetExecutablePath(string projectPa
return GetResponse<string>.Succeed(path);
}

public static bool TryGetExecutablePathFromOutput(IEnumerable<string> lines, [MaybeNullWhen(false)] out string output)
public static bool TryGetExecutablePathFromOutput(
IEnumerable<string> lines,
[MaybeNullWhen(false)] out string output)
{
foreach (var line in lines)
{
Expand Down
1 change: 1 addition & 0 deletions Synthesis.Bethesda.Execution/Settings/SynthesisProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ public class SynthesisProfile
public bool ConsiderPrereleaseNugets;
public bool LockToCurrentVersioning;
public PersistenceMode Persistence = PersistenceMode.None;
public bool IgnoreMissingMods;
}
}
20 changes: 10 additions & 10 deletions Synthesis.Bethesda.Execution/Synthesis.Bethesda.Execution.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Buildalyzer" Version="3.2.2" />
<PackageReference Include="Buildalyzer" Version="3.2.3" />
<PackageReference Include="GitInfo" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
<PackageReference Include="Microsoft.Build" Version="16.10.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.9.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.9.0" />
<PackageReference Include="Mutagen.Bethesda.Core" Version="0.30.4" />
<PackageReference Include="NuGet.Versioning" Version="5.10.0" />
<PackageReference Include="NuGetizer" Version="0.7.0">
<PackageReference Include="Microsoft.Build" Version="16.11.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.11.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.11.0" />
<PackageReference Include="Mutagen.Bethesda.Core" Version="0.31.0" />
<PackageReference Include="NuGet.Versioning" Version="5.11.0" />
<PackageReference Include="NuGetizer" Version="0.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Noggog.CSharpExt" Version="2.21.0" />
<PackageReference Include="Noggog.CSharpExt" Version="2.27.0" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions Synthesis.Bethesda.GUI/NoggogCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static class NoggogCommand
IObservable<TObject> objectSource,
Func<TObject, bool> canExecute,
Action<TObject> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand All @@ -88,7 +88,7 @@ public static class NoggogCommand
IObservable<TObject> objectSource,
Func<TObject, bool> canExecute,
Func<TObject, Task> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand All @@ -107,7 +107,7 @@ public static class NoggogCommand
Func<TObject, bool> canExecute,
IObservable<bool> extraCanExecute,
Action<TObject> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand All @@ -129,7 +129,7 @@ public static class NoggogCommand
Func<TObject, bool> canExecute,
IObservable<bool> extraCanExecute,
Func<TObject, Task> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand All @@ -150,7 +150,7 @@ public static class NoggogCommand
IObservable<TObject> objectSource,
Func<IObservable<TObject>, IObservable<bool>> canExecute,
Action<TObject> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand All @@ -169,7 +169,7 @@ public static class NoggogCommand
Func<IObservable<TObject>, IObservable<bool>> canExecute,
IObservable<bool> extraCanExecute,
Action<TObject> execute,
CompositeDisposable disposable)
IDisposableDropoff disposable)
{
TObject latest = default!;
objectSource
Expand Down
18 changes: 9 additions & 9 deletions Synthesis.Bethesda.GUI/Synthesis.Bethesda.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Humanizer.Core" Version="2.11.10" />
<PackageReference Include="Loqui" Version="2.21.0" />
<PackageReference Include="Loqui.Generation" Version="2.21.0" />
<PackageReference Include="Mutagen.Bethesda.WPF" Version="0.30.4" />
<PackageReference Include="Noggog.CSharpExt" Version="2.21.0" />
<PackageReference Include="Noggog.WPF" Version="2.21.0" />
<PackageReference Include="NuGetizer" Version="0.7.0">
<PackageReference Include="Loqui" Version="2.27.0" />
<PackageReference Include="Loqui.Generation" Version="2.27.0" />
<PackageReference Include="Mutagen.Bethesda.WPF" Version="0.31.0" />
<PackageReference Include="Noggog.CSharpExt" Version="2.27.0" />
<PackageReference Include="Noggog.WPF" Version="2.27.0" />
<PackageReference Include="NuGetizer" Version="0.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="reactiveui" Version="13.3.2" />
<PackageReference Include="ReactiveUI.Fody" Version="13.3.2" />
<PackageReference Include="reactiveui" Version="14.3.10" />
<PackageReference Include="ReactiveUI.Fody" Version="14.3.10" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="System.Linq.Async" Version="5.0.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions Synthesis.Bethesda.GUI/ViewModels/Config/GitPatcherVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public GitPatcherVM(ProfileVM parent, GithubPatcherSettings? settings = null)
{
this.TargetCommit = o.BranchSha!;
},
this.CompositeDisposable);
this);
UpdateToTagCommand = NoggogCommand.CreateFromObject(
objectSource: Observable.CombineLatest(
targetTag,
Expand All @@ -424,7 +424,7 @@ public GitPatcherVM(ProfileVM parent, GithubPatcherSettings? settings = null)
this.TargetTag = o.Tag!;
this.TargetCommit = o.TagSha!;
},
this.CompositeDisposable);
this);

// Get the selected versioning preferences
var patcherVersioning = Observable.CombineLatest(
Expand Down Expand Up @@ -821,7 +821,7 @@ public GitPatcherVM(ProfileVM parent, GithubPatcherSettings? settings = null)
{
try
{
if (!RunnableData.TryGet(out var runnable)) return;
if (RunnableData is not {} runnable) return;
if (runnable.Target == null)
{
Utility.NavigateToPath(RemoteRepoPath);
Expand Down Expand Up @@ -851,7 +851,7 @@ public GitPatcherVM(ProfileVM parent, GithubPatcherSettings? settings = null)
execute: v => ManualMutagenVersion = v ?? string.Empty,
extraCanExecute: this.WhenAnyValue(x => x.MutagenVersioning)
.Select(vers => vers == PatcherNugetVersioningEnum.Manual),
disposable: this.CompositeDisposable);
disposable: this);
UpdateSynthesisManualToLatestCommand = NoggogCommand.CreateFromObject(
objectSource: parent.Config.MainVM.NewestSynthesisVersion,
canExecute: v =>
Expand All @@ -864,7 +864,7 @@ public GitPatcherVM(ProfileVM parent, GithubPatcherSettings? settings = null)
execute: v => ManualSynthesisVersion = v ?? string.Empty,
extraCanExecute: this.WhenAnyValue(x => x.SynthesisVersioning)
.Select(vers => vers == PatcherNugetVersioningEnum.Manual),
disposable: this.CompositeDisposable);
disposable: this);

UpdateAllCommand = CommandExt.CreateCombinedAny(
UpdateMutagenManualToLatestCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class PatcherSettingsVM : ViewModel
loadOrder: parent.Profile.LoadOrder.Items.Select<ReadOnlyModListingVM, IModListingGetter>(lvm => lvm));
}
},
disposable: this.CompositeDisposable);
disposable: this );

_SettingsOpen = OpenSettingsCommand.IsExecuting
.ToGuiProperty(this, nameof(SettingsOpen));
Expand Down

0 comments on commit e765ef1

Please sign in to comment.