Skip to content

Commit

Permalink
Reverted inclusion of implicit mods
Browse files Browse the repository at this point in the history
Mucked up logic when run straight from VS or with an explicitly specified plugins.txt
  • Loading branch information
Noggog committed Nov 23, 2020
1 parent 0327eba commit b18e282
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Mutagen.Bethesda.Synthesis/Mutagen.Bethesda.Synthesis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mutagen.Bethesda" Version="0.21.5" />
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.21.5" />
<PackageReference Include="Mutagen.Bethesda" Version="0.21.6" />
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.21.6" />
<PackageReference Include="NuGetizer" Version="0.4.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
6 changes: 5 additions & 1 deletion Mutagen.Bethesda.Synthesis/SynthesisPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ public IEnumerable<LoadOrderListing> GetLoadOrder(
{
// This call will impliticly get Creation Club entries, too, as the Synthesis systems should be merging
// things into a singular load order file for consumption here
var loadOrderListing = PluginListings.ListingsFromPath(loadOrderFilePath, release, dataFolderPath);
var loadOrderListing =
ImplicitListings.GetListings(release, dataFolderPath)
.Select(x => new LoadOrderListing(x, enabled: true))
.Concat(PluginListings.RawListingsFromPath(loadOrderFilePath, release))
.Distinct(x => x.ModKey);
if (userPrefs?.InclusionMods != null)
{
var inclusions = userPrefs.InclusionMods.ToHashSet();
Expand Down
2 changes: 1 addition & 1 deletion Synthesis.Bethesda.Execution/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static async Task<bool> Run<TKey>(
loadOrderPath,
release,
loadOrderList,
removeImplicitMods: false);
removeImplicitMods: true);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PackageReference Include="Microsoft.CodeAnalysis" Version="3.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.8.0" />
<PackageReference Include="Mutagen.Bethesda.Core" Version="0.21.5" />
<PackageReference Include="Mutagen.Bethesda.Core" Version="0.21.6" />
<PackageReference Include="NuGetizer" Version="0.4.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
45 changes: 45 additions & 0 deletions Synthesis.Bethesda.UnitTests/PipelineTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using FluentAssertions;
using Mutagen.Bethesda;
using Mutagen.Bethesda.Synthesis;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Xunit;

namespace Synthesis.Bethesda.UnitTests
{
public class PipelineTests
{
[Fact]
public void AddsImplicitMods()
{
using var tmp = Utility.GetTempFolder();

var pluginPath = Path.Combine(tmp.Dir.Path, "Plugins.txt");
var dataFolder = Path.Combine(tmp.Dir.Path, "Data");
Directory.CreateDirectory(dataFolder);
File.WriteAllText(
Path.Combine(dataFolder, Mutagen.Bethesda.Skyrim.Constants.Skyrim.FileName),
string.Empty);
File.WriteAllLines(pluginPath,
new string[]
{
$"*{Utility.TestModKey.FileName}",
$"{Utility.OverrideModKey.FileName}",
});
var listings = SynthesisPipeline.Instance.GetLoadOrder(
GameRelease.SkyrimSE,
loadOrderFilePath: pluginPath,
dataFolderPath: dataFolder).ToList();
listings.Should().HaveCount(3);
listings.Should().BeEquivalentTo(new LoadOrderListing[]
{
new LoadOrderListing(Mutagen.Bethesda.Skyrim.Constants.Skyrim, true),
new LoadOrderListing(Utility.TestModKey, true),
new LoadOrderListing(Utility.OverrideModKey, false),
});
}
}
}
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="Mutagen.Bethesda" Version="0.21.5" />
<PackageReference Include="Mutagen.Bethesda" Version="0.21.6" />
<PackageReference Include="NuGetizer" Version="0.4.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Synthesis.Bethesda/Synthesis.Bethesda.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.21.5" />
<PackageReference Include="Mutagen.Bethesda.Kernel" Version="0.21.6" />
<PackageReference Include="NuGetizer" Version="0.4.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit b18e282

Please sign in to comment.