Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions BepInEx.Core/BepInEx.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,24 @@
<Description>BepInEx Core library</Description>
<TargetFrameworks>net10.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- Force nuget assembly output on netstandard2.0 -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\HarmonyX\Harmony\Harmony.csproj"/>
<ProjectReference Include="..\HarmonyX\Harmony\Harmony.csproj" SetTargetFramework="TargetFramework=netstandard2.0"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All"/>
<PackageReference Include="SemanticVersioning" Version="3.0.0"/>
<PackageReference Include="MonoMod.Utils" Version="25.0.14"/>
<PackageReference Include="Mono.Cecil" Version="0.11.6" />
<PackageReference Include="System.Drawing.Common" Version="10.0.2" />
<PackageReference Include="System.Drawing.Common" Version="10.0.12" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Contract\IPlugin.cs"/>
</ItemGroup>

<!-- CopyLocalLockFileAssemblies causes to also output shared assemblies: https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
<!-- Since all core assemblies usually follow naming of System.*, we just delete them for now -->
<!-- Also delete deps.json as they are not used by mono -->
<!-- Also delete deps.json as they are not used at runtime -->
<Target Name="DeleteSys" AfterTargets="Build">
<ItemGroup>
<FilesToDelete Include="$(OutputPath)System.*.dll"/>
Expand Down
7 changes: 0 additions & 7 deletions BepInEx.Core/Console/Windows/Kon.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using System;
using System.Runtime.InteropServices;
#if NET35
using System.Security.Permissions;

#endif

namespace BepInEx.ConsoleUtil
{
Expand Down Expand Up @@ -93,9 +89,6 @@ private static CONSOLE_SCREEN_BUFFER_INFO GetBufferInfo(bool throwOnNoConsole, o

private static void SetConsoleColor(bool isBackground, ConsoleColor c)
{
#if NET35
new UIPermission(UIPermissionWindow.SafeTopLevelWindows).Demand();
#endif
var color = ConsoleColorToColorAttribute((short) c, isBackground);
bool flag;
var bufferInfo = GetBufferInfo(false, out flag);
Expand Down
4 changes: 0 additions & 4 deletions BepInEx.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("BepInEx.Preloader.Core")]
[assembly: InternalsVisibleTo("BepInEx.Unity.Mono")]
[assembly: InternalsVisibleTo("BepInEx.NET.Framework.Launcher")]
[assembly: InternalsVisibleTo("BepInEx.NET.CoreCLR")]
[assembly: InternalsVisibleTo("BepInEx.Unity.IL2CPP")]
[assembly: InternalsVisibleTo("BepInExTests")]
3 changes: 1 addition & 2 deletions BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
<ProjectReference Include="..\HarmonyX\Harmony\Harmony.csproj"/>
<ProjectReference Include="..\HarmonyX\Harmony\Harmony.csproj" SetTargetFramework="TargetFramework=netstandard2.0"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All"/>
<PackageReference Include="MonoMod.Utils" Version="25.0.14"/>
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions BepInEx.Preloader.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("BepInEx.Unity.Mono.Preloader")]
[assembly: InternalsVisibleTo("BepInEx.NET.Framework.Launcher")]
[assembly: InternalsVisibleTo("BepInEx.NET.CoreCLR")]
[assembly: InternalsVisibleTo("BepInEx.Unity.IL2CPP")]
119 changes: 0 additions & 119 deletions BepInEx.sln

This file was deleted.

24 changes: 24 additions & 0 deletions BepInEx.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Solution>
<Configurations>
<BuildType Name="Debug" />
<BuildType Name="Release" />
</Configurations>
<Folder Name="/NET/">
<Project Path="Runtimes/NET/BepInEx.NET.Common/BepInEx.NET.Common.csproj" />
<Project Path="Runtimes/NET/BepInEx.NET.CoreCLR/BepInEx.NET.CoreCLR.csproj" />
<Project Path="Runtimes/NET/BepInEx.NET.Shared/BepInEx.NET.Shared.shproj" />
<Project Path="Runtimes/NET/BepisLoader/BepisLoader.csproj" />
</Folder>
<Folder Name="/Shared/">
<File Path="Directory.Build.props" />
</Folder>
<Folder Name="/Shared/Markdown/">
<File Path="README.md" />
</Folder>
<Project Path="BepInEx.Core/BepInEx.Core.csproj" />
<Project Path="BepInEx.Preloader.Core/BepInEx.Preloader.Core.csproj" />
<Project Path="build/Build.csproj">
<Build Solution="Debug|*" Project="false" />
<Build Solution="Release|*" Project="false" />
</Project>
</Solution>
6 changes: 1 addition & 5 deletions Runtimes/NET/BepInEx.NET.Common/BepInEx.NET.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
<TargetFrameworks>net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\BepInEx.Core\BepInEx.Core.csproj"/>
<ProjectReference Include="..\..\..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj"/>
<ProjectReference Include="..\..\..\HarmonyX\Harmony\Harmony.csproj"/>
<ProjectReference Include="..\..\..\HarmonyX\Harmony\Harmony.csproj" SetTargetFramework="TargetFramework=netstandard2.0"/>
</ItemGroup>

</Project>
8 changes: 3 additions & 5 deletions build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="5.0.0"/>
<PackageReference Include="Cake.Frosting.Git" Version="5.0.1"/>
<PackageReference Include="Cake.Incubator" Version="8.0.0"/>
<PackageReference Include="Cake.Json" Version="7.0.1"/>
<PackageReference Include="Microsoft.Build" Version="17.14.28"/>
<PackageReference Include="Cake.Frosting" Version="6.3.0"/>
<PackageReference Include="Cake.Json" Version="11.0.0"/>
<PackageReference Include="Microsoft.Build" Version="18.9.6"/>
</ItemGroup>
<ItemGroup>
<Content Include="$(SolutionDir)/.github/workflows/*.yml" LinkBase="ci"/>
Expand Down
17 changes: 17 additions & 0 deletions build/GitTasks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
using Cake.Common;
using Cake.Core;
using Cake.Core.IO;

/// <summary>Represents a Git commit.</summary>
/// <param name="Sha">The full commit hash, represented as a hexadecimal string.</param>
public sealed record GitCommit(string Sha);
Comment thread
hazre marked this conversation as resolved.
/// <summary>Represents a Git branch.</summary>
/// <param name="FriendlyName">The branch friendly name.</param>
public sealed record GitBranch(string FriendlyName);

static class GitTasks
{
Expand All @@ -9,4 +17,13 @@ public static string Git(this ICakeContext ctx, string args, string separator =
process.WaitForExit();
return string.Join(separator, process.GetStandardOutput());
}

public static GitCommit GitLogTip(this ICakeContext ctx, DirectoryPath repository) =>
new(ctx.Git($"-C \"{repository.FullPath}\" rev-parse HEAD").Trim());

public static GitBranch GitBranchCurrent(this ICakeContext ctx, DirectoryPath repository) =>
new(ctx.Git($"-C \"{repository.FullPath}\" rev-parse --abbrev-ref HEAD").Trim());

public static string GitShortenSha(this ICakeContext ctx, DirectoryPath repository, GitCommit commit) =>
ctx.Git($"-C \"{repository.FullPath}\" rev-parse --short=7 {commit.Sha}").Trim();
}
Loading
Loading