Skip to content

Commit

Permalink
Merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Aug 8, 2024
1 parent 0d42102 commit f75c9da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public void Modify(
out var curListedVersions);
_turnOffNullability.TurnOff(projXml);
_removeGitInfo.Remove(projXml);
_swapToProperNetVersion.Swap(projXml, targetMutagenNugetVersion);
_turnOffWindowsSpec.TurnOff(projXml);
System.Version.TryParse(TrimVersion(curListedVersions.Mutagen), out var mutaVersion);
System.Version.TryParse(TrimVersion(curListedVersions.Synthesis), out var synthVersion);
Expand All @@ -106,6 +105,11 @@ public void Modify(
_removeProject.Remove(projXml, "Newtonsoft.Json");
}

if (targetMutaVersion != null)
{
_swapToProperNetVersion.Swap(projXml, targetMutaVersion);
}

if (targetMutaVersion != null && targetSynthesisVersion != null)
{
_addAllReleasesToOldVersions.Add(projXml, synthVersion, targetMutaVersion, targetSynthesisVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace Synthesis.Bethesda.Execution.Patchers.Git.ModifyProject;

public interface ISwapToProperNetVersion
{
void Swap(XElement proj, NuGetVersion targetMutagenVersion);
void Swap(XElement proj, Version targetMutagenVersion);
}

public class SwapToProperNetVersion : ISwapToProperNetVersion
{
private const int NetNum = 8;
private readonly NuGetVersion Net8Version = new NuGetVersion(0, 45, 0);
private readonly Version Net8Version = new Version(0, 45);

private void ProcessTargetFrameworkNode(XElement elem, NuGetVersion targetMutagenVersion)
private void ProcessTargetFrameworkNode(XElement elem, Version targetMutagenVersion)
{
if (!elem.Name.LocalName.Equals("TargetFramework")) return;
if (targetMutagenVersion < Net8Version)
Expand All @@ -36,7 +36,7 @@ private static void ProcessLegacy(XElement elem)
}
}

private static void ProcessNet8(XElement elem, NuGetVersion targetMutagenVersion)
private static void ProcessNet8(XElement elem, Version targetMutagenVersion)
{
if (!elem.Value.StartsWith("net"))
{
Expand All @@ -52,7 +52,7 @@ private static void ProcessNet8(XElement elem, NuGetVersion targetMutagenVersion
elem.Value = $"net{NetNum}.0";
}

public void Swap(XElement proj, NuGetVersion targetMutagenVersion)
public void Swap(XElement proj, Version targetMutagenVersion)
{
foreach (var group in proj.Elements("PropertyGroup"))
{
Expand Down

0 comments on commit f75c9da

Please sign in to comment.