diff --git a/Runtimes/NET/BepInEx.NET.CoreCLR/BepInEx.NET.CoreCLR.csproj b/Runtimes/NET/BepInEx.NET.CoreCLR/BepInEx.NET.CoreCLR.csproj index d42685d..5aafa90 100644 --- a/Runtimes/NET/BepInEx.NET.CoreCLR/BepInEx.NET.CoreCLR.csproj +++ b/Runtimes/NET/BepInEx.NET.CoreCLR/BepInEx.NET.CoreCLR.csproj @@ -2,10 +2,10 @@ BepInEx support library for CoreCLR games - netcoreapp3.1 + netcoreapp3.1;net6.0 $(BuildDir)/NET.CoreCLR true - false + true diff --git a/Runtimes/NET/BepInEx.NET.Framework.Launcher/BepInEx.NET.Framework.Launcher.csproj b/Runtimes/NET/BepInEx.NET.Framework.Launcher/BepInEx.NET.Framework.Launcher.csproj index 5e5fe96..274dc40 100644 --- a/Runtimes/NET/BepInEx.NET.Framework.Launcher/BepInEx.NET.Framework.Launcher.csproj +++ b/Runtimes/NET/BepInEx.NET.Framework.Launcher/BepInEx.NET.Framework.Launcher.csproj @@ -2,9 +2,9 @@ BepInEx support library for .NET Framework games Exe - net452 + net40;net452 true - false + true x86 $(BuildDir)/NET.Framework diff --git a/Runtimes/NET/BepInEx.NET.Shared/BepInEx.NET.Shared.shproj b/Runtimes/NET/BepInEx.NET.Shared/BepInEx.NET.Shared.shproj index 779cd4d..77757e6 100644 --- a/Runtimes/NET/BepInEx.NET.Shared/BepInEx.NET.Shared.shproj +++ b/Runtimes/NET/BepInEx.NET.Shared/BepInEx.NET.Shared.shproj @@ -4,10 +4,13 @@ 067bcc8c-fc25-4929-b4f4-c6a5a7496994 14.0 - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/build/DistributionTarget.cs b/build/DistributionTarget.cs index 6aed13c..2e91da3 100644 --- a/build/DistributionTarget.cs +++ b/build/DistributionTarget.cs @@ -1,12 +1,35 @@ -using System; +using System; -readonly record struct DistributionTarget(string DistributionIdentifier, string RuntimeIndentifier) +readonly struct DistributionTarget { - public readonly string Arch = RuntimeIndentifier.Split('-')[1]; - public readonly string Engine = DistributionIdentifier.Split('.')[0]; - public readonly string Os = RuntimeIndentifier.Split('-')[0]; - public readonly string Runtime = DistributionIdentifier.Split('.')[1]; - public readonly string Target = $"{DistributionIdentifier}-{RuntimeIndentifier}"; + public DistributionTarget(string distributionIdentifier, string runtimeIdentifier) + { + DistributionIdentifier = distributionIdentifier; + RuntimeIdentifier = runtimeIdentifier; + FrameworkTarget = null; + + Os = RuntimeIdentifier.Split('-')[0]; + Arch = RuntimeIdentifier.Split('-')[1]; + Engine = DistributionIdentifier.Split('.')[0]; + Runtime = DistributionIdentifier.Split('.')[1]; + Target = $"{DistributionIdentifier}-{RuntimeIdentifier}"; + } + + public DistributionTarget(string distributionIdentifier, string runtimeIdentifier, string frameworkTarget) : this(distributionIdentifier, runtimeIdentifier) + { + FrameworkTarget = frameworkTarget; + Target = $"{DistributionIdentifier}-{FrameworkTarget}-{RuntimeIdentifier}"; + } + + public readonly string DistributionIdentifier; + public readonly string RuntimeIdentifier; + public readonly string FrameworkTarget; + + public readonly string Arch; + public readonly string Engine; + public readonly string Os; + public readonly string Runtime; + public readonly string Target; public string ClearOsName => Os switch { diff --git a/build/Program.cs b/build/Program.cs index ea5f0a9..1189597 100644 --- a/build/Program.cs +++ b/build/Program.cs @@ -50,8 +50,10 @@ public class BuildContext : FrostingContext new("Unity.IL2CPP", "win-x64"), new("Unity.IL2CPP", "linux-x64"), new("Unity.IL2CPP", "macos-x64"), - new("NET.Framework", "win-x64"), - new("NET.CoreCLR", "win-x64") + new("NET.Framework", "win-x86", "net40"), + new("NET.Framework", "win-x86", "net452"), + new("NET.CoreCLR", "win-x64", "netcoreapp3.1"), + new("NET.CoreCLR", "win-x64", "net6.0") }; @@ -241,8 +243,12 @@ public sealed class MakeDistTask : FrostingTask ctx.CreateDirectory(bepInExDir.Combine("patchers")); File.WriteAllText(targetDir.CombineWithFilePath("changelog.txt").FullPath, changelog); - foreach (var filePath in ctx.GetFiles(ctx.OutputDirectory.Combine(dist.DistributionIdentifier) - .Combine("*.*").FullPath)) + + var sourceDirectory = ctx.OutputDirectory.Combine(dist.DistributionIdentifier); + if (dist.FrameworkTarget != null) + sourceDirectory = sourceDirectory.Combine(dist.FrameworkTarget); + + foreach (var filePath in ctx.GetFiles(sourceDirectory.Combine("*.*").FullPath)) ctx.CopyFileToDirectory(filePath, bepInExCoreDir); if (dist.Engine == "Unity") @@ -269,21 +275,24 @@ public sealed class MakeDistTask : FrostingTask { ctx.CopyFile(ctx.CacheDirectory.Combine("dobby").Combine($"dobby_{dist.Os}").CombineWithFilePath($"{dist.DllPrefix}dobby_{dist.Arch}.{dist.DllExtension}"), bepInExCoreDir.CombineWithFilePath($"{dist.DllPrefix}dobby.{dist.DllExtension}")); - ctx.CopyDirectory(ctx.CacheDirectory.Combine("dotnet").Combine(dist.RuntimeIndentifier), + ctx.CopyDirectory(ctx.CacheDirectory.Combine("dotnet").Combine(dist.RuntimeIdentifier), targetDir.Combine("dotnet")); } } - - if (dist.DistributionIdentifier == "NET.Framework") + else if (dist.Engine == "NET") { - ctx.DeleteFile(bepInExCoreDir.CombineWithFilePath("BepInEx.NET.Framework.Launcher.exe.config")); - foreach (var filePath in ctx.GetFiles(bepInExCoreDir.Combine("BepInEx.NET.*").FullPath)) - ctx.MoveFileToDirectory(filePath, targetDir); - } + if (dist.Runtime == "Framework") + { + ctx.DeleteFile(bepInExCoreDir.CombineWithFilePath("BepInEx.NET.Framework.Launcher.exe.config")); - if (dist.DistributionIdentifier == "NET.CoreCLR") - foreach (var filePath in ctx.GetFiles(bepInExCoreDir.Combine("BepInEx.NET.CoreCLR.*").FullPath)) - ctx.MoveFileToDirectory(filePath, targetDir); + ctx.MoveFileToDirectory(bepInExCoreDir.CombineWithFilePath("BepInEx.NET.Framework.Launcher.exe"), targetDir); + } + else if (dist.Runtime == "CoreCLR") + { + foreach (var filePath in ctx.GetFiles(bepInExCoreDir.Combine("BepInEx.NET.CoreCLR.*").FullPath)) + ctx.MoveFileToDirectory(filePath, targetDir); + } + } } } } @@ -347,7 +356,7 @@ public sealed class PublishTask : FrostingTask { ["file"] = $"BepInEx-{d.Target}-{ctx.BuildPackageVersion}.zip", ["description"] = - $"BepInEx {d.Engine} ({d.Runtime}) for {d.ClearOsName} ({d.Arch}) games" + $"BepInEx {d.Engine} ({d.Runtime}{(d.FrameworkTarget == null ? "" : " " + d.FrameworkTarget)}) for {d.ClearOsName} ({d.Arch}) games" }).ToArray() }); }