mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Restructure versioning and project configuration
To simplify versioning and configuration: * Removed BepInEx.Shared * Removed BuildInfoAttribute * Moved shared configuration to Directory.Build.props * Refactored to use VersionSuffix and SourceRevisionId for embedding BE and commit hash info * Enabled debug info embedding
This commit is contained in:
1 parent
28487d237a
commit
d190b069a1
16 files changed
+64
-180
No files matched your search
@@ -1,24 +1,15 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>BepInEx Core library</Description>
|
<Description>BepInEx Core library</Description>
|
||||||
<TargetFrameworks>net35;netstandard2.0;netstandard2.1</TargetFrameworks>
|
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<AssemblyTitle>BepInEx</AssemblyTitle>
|
<AssemblyTitle>BepInEx</AssemblyTitle>
|
||||||
<Product>BepInEx</Product>
|
<Product>BepInEx</Product>
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
<OutputPath>..\bin\Core\</OutputPath>
|
<OutputPath>..\bin\Core\</OutputPath>
|
||||||
<DocumentationFile>$(OutputPath)\$(TargetFramework)\BepInEx.Core.xml</DocumentationFile>
|
|
||||||
<Description>Unity plugin injection framework</Description>
|
<Description>Unity plugin injection framework</Description>
|
||||||
<!-- Force nuget assembly output on netstandard2.1 -->
|
<!-- Force nuget assembly output on netstandard2.1 -->
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
||||||
@@ -28,7 +19,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Contract\IPlugin.cs"/>
|
<Compile Remove="Contract\IPlugin.cs"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
|
|
||||||
<!-- CopyLocalLockFileAssemblies causes to also output shared assemblies: https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
|
<!-- 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 -->
|
<!-- Since all core assemblies usually follow naming of System.*, we just delete them for now -->
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ namespace BepInEx;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Paths
|
public static class Paths
|
||||||
{
|
{
|
||||||
|
// TODO: Why is this in Paths?
|
||||||
|
/// <summary>
|
||||||
|
/// BepInEx version.
|
||||||
|
/// </summary>
|
||||||
public static Version BepInExVersion { get; } =
|
public static Version BepInExVersion { get; } =
|
||||||
Version.Parse(MetadataHelper.GetAttributes<AssemblyInformationalVersionAttribute>(typeof(Paths).Assembly)[0]
|
Version.Parse(MetadataHelper.GetAttributes<AssemblyInformationalVersionAttribute>(typeof(Paths).Assembly)[0]
|
||||||
.InformationalVersion);
|
.InformationalVersion);
|
||||||
|
|||||||
@@ -7,18 +7,8 @@
|
|||||||
<Product>BepInEx.IL2CPP</Product>
|
<Product>BepInEx.IL2CPP</Product>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<OutputPath>..\bin\IL2CPP\</OutputPath>
|
<OutputPath>..\bin\IL2CPP\</OutputPath>
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
<Configurations>Debug;Release</Configurations>
|
|
||||||
<Platforms>AnyCPU</Platforms>
|
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugType>embedded</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
||||||
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" PrivateAssets="All"/>
|
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" PrivateAssets="All"/>
|
||||||
@@ -35,11 +25,10 @@
|
|||||||
<PackageReference Include="MonoMod.RuntimeDetour" Version="22.5.1.1"/>
|
<PackageReference Include="MonoMod.RuntimeDetour" Version="22.5.1.1"/>
|
||||||
<PackageReference Include="Samboy063.Cpp2IL.Core" Version="2022.0.5"/>
|
<PackageReference Include="Samboy063.Cpp2IL.Core" Version="2022.0.5"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
|
|
||||||
<!-- CopyLocalLockFileAssemblies causes to also output shared assemblies: https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
|
<!-- 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 -->
|
<!-- 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 by embedded CLR -->
|
||||||
<Target Name="DeleteSys" AfterTargets="Build">
|
<Target Name="DeleteSys" AfterTargets="Build">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FilesToDelete Include="$(OutputPath)System.*.dll"/>
|
<FilesToDelete Include="$(OutputPath)System.*.dll"/>
|
||||||
|
|||||||
@@ -4,21 +4,10 @@
|
|||||||
<TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.1;net6</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.NetLauncher.Common\BepInEx.NetLauncher.Common.csproj" />
|
<ProjectReference Include="..\BepInEx.NetLauncher.Common\BepInEx.NetLauncher.Common.csproj" />
|
||||||
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" />
|
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project="..\BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.projitems" Label="Shared" />
|
<Import Project="..\BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.projitems" Label="Shared" />
|
||||||
|
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared" />
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -6,20 +6,9 @@
|
|||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<AssemblyTitle>BepInEx.NetLauncher</AssemblyTitle>
|
<AssemblyTitle>BepInEx.NetLauncher</AssemblyTitle>
|
||||||
<Product>BepInEx.NetLauncher</Product>
|
<Product>BepInEx.NetLauncher</Product>
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<OutputPath>bin\Debug</OutputPath>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<OutputPath>..\bin\NetLauncher\</OutputPath>
|
<OutputPath>..\bin\NetLauncher\</OutputPath>
|
||||||
<DocumentationFile/>
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
||||||
@@ -30,6 +19,5 @@
|
|||||||
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
<Import Project="..\BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.projitems" Label="Shared"/>
|
<Import Project="..\BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.projitems" Label="Shared"/>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,24 +1,14 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>Core classes and utilities for BepInEx Preloader</Description>
|
<Description>Core classes and utilities for BepInEx Preloader</Description>
|
||||||
<TargetFrameworks>net35;netstandard2.0;netstandard2.1</TargetFrameworks>
|
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
||||||
<AssemblyTitle>BepInEx.Preloader.Core</AssemblyTitle>
|
<AssemblyTitle>BepInEx.Preloader.Core</AssemblyTitle>
|
||||||
<Product>BepInEx.Preloader.Core</Product>
|
<Product>BepInEx.Preloader.Core</Product>
|
||||||
<OutputPath>..\bin\Core</OutputPath>
|
<OutputPath>..\bin\Core</OutputPath>
|
||||||
<DocumentationFile>$(OutputPath)\$(TargetFramework)\BepInEx.Preloader.Core.xml</DocumentationFile>
|
|
||||||
<LangVersion>10</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using BepInEx.Logging;
|
using BepInEx.Logging;
|
||||||
using BepInEx.Shared;
|
|
||||||
using MonoMod.Utils;
|
using MonoMod.Utils;
|
||||||
|
|
||||||
namespace BepInEx.Preloader.Core.Logging;
|
namespace BepInEx.Preloader.Core.Logging;
|
||||||
@@ -35,20 +34,17 @@ public static class ChainloaderLogHelper
|
|||||||
|
|
||||||
public static void PrintLogInfo(ManualLogSource log)
|
public static void PrintLogInfo(ManualLogSource log)
|
||||||
{
|
{
|
||||||
var consoleTitle = $"BepInEx {Paths.BepInExVersion} - {Paths.ProcessName}";
|
var bepinVersion = Paths.BepInExVersion;
|
||||||
|
var versionMini = new SemanticVersioning.Version(bepinVersion.Major, bepinVersion.Minor, bepinVersion.Patch,
|
||||||
|
bepinVersion.PreRelease);
|
||||||
|
var consoleTitle = $"BepInEx {versionMini} - {Paths.ProcessName}";
|
||||||
log.Log(LogLevel.Message, consoleTitle);
|
log.Log(LogLevel.Message, consoleTitle);
|
||||||
|
|
||||||
if (ConsoleManager.ConsoleActive)
|
if (ConsoleManager.ConsoleActive)
|
||||||
ConsoleManager.SetConsoleTitle(consoleTitle);
|
ConsoleManager.SetConsoleTitle(consoleTitle);
|
||||||
|
|
||||||
//See BuildInfoAttribute for more information about this section.
|
if (!string.IsNullOrEmpty(bepinVersion.Build))
|
||||||
var attributes = typeof(BuildInfoAttribute).Assembly.GetCustomAttributes(typeof(BuildInfoAttribute), false);
|
log.Log(LogLevel.Message, $"Build information: {bepinVersion.Build}");
|
||||||
|
|
||||||
if (attributes.Length > 0)
|
|
||||||
{
|
|
||||||
var attribute = (BuildInfoAttribute) attributes[0];
|
|
||||||
log.Log(LogLevel.Message, attribute.Info);
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.Log(LogLevel.Info, $"System platform: {GetPlatformString()}");
|
Logger.Log(LogLevel.Info, $"System platform: {GetPlatformString()}");
|
||||||
Logger.Log(LogLevel.Info,
|
Logger.Log(LogLevel.Info,
|
||||||
|
|||||||
@@ -3,20 +3,13 @@
|
|||||||
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
||||||
<AssemblyTitle>BepInEx.Preloader.Unity</AssemblyTitle>
|
<AssemblyTitle>BepInEx.Preloader.Unity</AssemblyTitle>
|
||||||
<Product>BepInEx.Preloader.Unity</Product>
|
<Product>BepInEx.Preloader.Unity</Product>
|
||||||
<LangVersion>10</LangVersion>
|
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
|
||||||
<!-- Output only net35 version to distribution; netstadnard is only used for generating NuGet package -->
|
<!-- Output only net35 version to distribution; netstadnard is only used for generating NuGet package -->
|
||||||
<OutputPath>..\bin\Unity\</OutputPath>
|
<OutputPath>..\bin\Unity\</OutputPath>
|
||||||
<DocumentationFile>$(OutputPath)\BepInEx.Preloader.Unity.xml</DocumentationFile>
|
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
||||||
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj"/>
|
||||||
@@ -25,5 +18,4 @@
|
|||||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All"/>
|
||||||
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
|
||||||
<HasSharedItems>true</HasSharedItems>
|
|
||||||
<SharedGUID>E312EFD4-47ED-4DCE-B279-6B0EE314989F</SharedGUID>
|
|
||||||
<Copyright>Copyright © 2021 BepInEx Team</Copyright>
|
|
||||||
<Version>6.0.0</Version>
|
|
||||||
<Authors>BepInEx</Authors>
|
|
||||||
<PackageProjectUrl>https://github.com/BepInEx/BepInEx</PackageProjectUrl>
|
|
||||||
<PackageLicenseUrl>https://github.com/BepInEx/BepInEx/blob/master/LICENSE</PackageLicenseUrl>
|
|
||||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
|
||||||
<PackageIcon>logo.png</PackageIcon>
|
|
||||||
<PackageOutputPath>../bin/NuGet</PackageOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Label="Configuration">
|
|
||||||
<Import_RootNamespace>BepInEx.Shared</Import_RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)BuildInfoAttribute.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="..\assets\logo.png" Pack="true" Visible="false" PackagePath="" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup Condition="'$(BuildInfo)' != ''">
|
|
||||||
<AssemblyAttribute Include="BepInEx.Shared.BuildInfoAttribute">
|
|
||||||
<_Parameter1>$(BuildInfo)</_Parameter1>
|
|
||||||
</AssemblyAttribute>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{5C7847FB-C16D-47BD-BB17-1045669F9AA7}</ProjectGuid>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props"/>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props"/>
|
|
||||||
<Import Project="BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets"/>
|
|
||||||
</Project>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace BepInEx.Shared;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This class is appended to AssemblyInfo.cs when BepInEx is built via a CI pipeline.
|
|
||||||
/// It is mainly intended to signify that the current build is not a release build and is special, like for instance a
|
|
||||||
/// bleeding edge build.
|
|
||||||
/// </summary>
|
|
||||||
[AttributeUsage(AttributeTargets.Assembly)]
|
|
||||||
public class BuildInfoAttribute : Attribute
|
|
||||||
{
|
|
||||||
public BuildInfoAttribute(string info)
|
|
||||||
{
|
|
||||||
Info = info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Info { get; }
|
|
||||||
}
|
|
||||||
@@ -4,21 +4,13 @@
|
|||||||
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
|
||||||
<AssemblyTitle>BepInEx.Unity</AssemblyTitle>
|
<AssemblyTitle>BepInEx.Unity</AssemblyTitle>
|
||||||
<Product>BepInEx.Unity</Product>
|
<Product>BepInEx.Unity</Product>
|
||||||
<LangVersion>10</LangVersion>
|
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net35'">
|
||||||
<!-- Output only net35 version to distribution; netstandard is only used for generating NuGet package -->
|
<!-- Output only net35 version to distribution; netstandard is only used for generating NuGet package -->
|
||||||
<OutputPath>..\bin\Unity\</OutputPath>
|
<OutputPath>..\bin\Unity\</OutputPath>
|
||||||
<DocumentationFile>$(OutputPath)\BepInEx.Unity.xml</DocumentationFile>
|
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
<ProjectReference Include="..\BepInEx.Core\BepInEx.Core.csproj"/>
|
||||||
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" PrivateAssets="All"/>
|
<ProjectReference Include="..\BepInEx.Preloader.Core\BepInEx.Preloader.Core.csproj" PrivateAssets="All"/>
|
||||||
@@ -29,5 +21,4 @@
|
|||||||
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
<PackageReference Include="HarmonyX" Version="2.10.0"/>
|
||||||
<PackageReference Include="UnityEngine" Version="5.6.1" IncludeAssets="compile"/>
|
<PackageReference Include="UnityEngine" Version="5.6.1" IncludeAssets="compile"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\BepInEx.Shared\BepInEx.Shared.projitems" Label="Shared"/>
|
|
||||||
</Project>
|
</Project>
|
||||||
+13
-8
@@ -31,8 +31,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Markdown", "Markdown", "{68
|
|||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BepInEx.Shared", "BepInEx.Shared\BepInEx.Shared.shproj", "{5C7847FB-C16D-47BD-BB17-1045669F9AA7}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BepInEx.NetLauncher.Common", "BepInEx.NetLauncher.Common\BepInEx.NetLauncher.Common.csproj", "{76EB1952-7826-471C-9CF3-815D094DA077}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BepInEx.NetLauncher.Common", "BepInEx.NetLauncher.Common\BepInEx.NetLauncher.Common.csproj", "{76EB1952-7826-471C-9CF3-815D094DA077}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BepInEx.NetCore", "BepInEx.NetCore\BepInEx.NetCore.csproj", "{08083F40-98AA-4176-BA01-817C18C35C7F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BepInEx.NetCore", "BepInEx.NetCore\BepInEx.NetCore.csproj", "{08083F40-98AA-4176-BA01-817C18C35C7F}"
|
||||||
@@ -40,12 +38,17 @@ EndProject
|
|||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BepInEx.NetLauncher.Shared", "BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.shproj", "{067BCC8C-FC25-4929-B4F4-C6A5A7496994}"
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BepInEx.NetLauncher.Shared", "BepInEx.NetLauncher.Shared\BepInEx.NetLauncher.Shared.shproj", "{067BCC8C-FC25-4929-B4F4-C6A5A7496994}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{A6DDBD9E-773C-437A-88AA-995BC5FE90DF}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{A6DDBD9E-773C-437A-88AA-995BC5FE90DF}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
build.bat = build.bat
|
build.bat = build.bat
|
||||||
build.sh = build.sh
|
build.sh = build.sh
|
||||||
build.ps1 = build.ps1
|
build.ps1 = build.ps1
|
||||||
build.cake = build.cake
|
build.cake = build.cake
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{12081C35-76DF-450C-AC83-1E1CB84516AA}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
Directory.Build.props = Directory.Build.props
|
||||||
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
@@ -146,6 +149,8 @@ Global
|
|||||||
{76EB1952-7826-471C-9CF3-815D094DA077} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
{76EB1952-7826-471C-9CF3-815D094DA077} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
||||||
{08083F40-98AA-4176-BA01-817C18C35C7F} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
{08083F40-98AA-4176-BA01-817C18C35C7F} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
||||||
{067BCC8C-FC25-4929-B4F4-C6A5A7496994} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
{067BCC8C-FC25-4929-B4F4-C6A5A7496994} = {6EC98884-A3DC-4828-85EF-5F10F7519429}
|
||||||
|
{68C57430-3E92-4B50-A9A5-208FE9CCD914} = {12081C35-76DF-450C-AC83-1E1CB84516AA}
|
||||||
|
{A6DDBD9E-773C-437A-88AA-995BC5FE90DF} = {12081C35-76DF-450C-AC83-1E1CB84516AA}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {55AC11EF-F568-4C79-A356-7ED9510145B1}
|
SolutionGuid = {55AC11EF-F568-4C79-A356-7ED9510145B1}
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<VersionPrefix>6.0.0</VersionPrefix>
|
||||||
|
<Authors>BepInEx</Authors>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<Nullable>disable</Nullable>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<DebugType>embedded</DebugType>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
|
<PackageProjectUrl>https://github.com/BepInEx/BepInEx</PackageProjectUrl>
|
||||||
|
<RepositoryUrl>https://github.com/BepInEx/BepInEx</RepositoryUrl>
|
||||||
|
<RepositoryType>git</RepositoryType>
|
||||||
|
<Copyright>Copyright © 2022 BepInEx Team</Copyright>
|
||||||
|
<PackageOutputPath>../bin/NuGet</PackageOutputPath>
|
||||||
|
<PackageIcon>logo.png</PackageIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="..\assets\logo.png" Pack="true" Visible="false" PackagePath=""/>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
+10
-24
@@ -13,7 +13,6 @@ var cleanDependencyCache = Argument("clean_build_cache", false);
|
|||||||
var lastBuildCommit = Argument("last_build_commit", "");
|
var lastBuildCommit = Argument("last_build_commit", "");
|
||||||
var nugetPushSource = Argument("nuget_push_source", "https://nuget.bepinex.dev/v3/index.json");
|
var nugetPushSource = Argument("nuget_push_source", "https://nuget.bepinex.dev/v3/index.json");
|
||||||
var nugetPushKey = Argument("nuget_push_key", "");
|
var nugetPushKey = Argument("nuget_push_key", "");
|
||||||
var customBuildVersion = Argument("build_version", "");
|
|
||||||
|
|
||||||
var buildVersion = "";
|
var buildVersion = "";
|
||||||
var currentCommit = RunGit("rev-parse HEAD");
|
var currentCommit = RunGit("rev-parse HEAD");
|
||||||
@@ -83,9 +82,8 @@ Task("Build")
|
|||||||
.IsDependentOn("Cleanup")
|
.IsDependentOn("Cleanup")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var bepinExProperties = Directory("./BepInEx.Shared");
|
// Used in later phases
|
||||||
|
buildVersion = FindRegexMatchGroupInFile(File("Directory.Build.props"), @"\<VersionPrefix\>([0-9]+\.[0-9]+\.[0-9]+)\<\/VersionPrefix\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
|
||||||
buildVersion = FindRegexMatchGroupInFile(bepinExProperties + File("BepInEx.Shared.projitems"), @"\<Version\>([0-9]+\.[0-9]+\.[0-9]+)\<\/Version\>", 1, System.Text.RegularExpressions.RegexOptions.None).Value;
|
|
||||||
|
|
||||||
var buildSettings = new DotNetBuildSettings {
|
var buildSettings = new DotNetBuildSettings {
|
||||||
Configuration = "Release",
|
Configuration = "Release",
|
||||||
@@ -93,21 +91,10 @@ Task("Build")
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (isBleedingEdge) {
|
if (isBleedingEdge) {
|
||||||
buildSettings.MSBuildSettings.Properties["BuildInfo"] = new[] {
|
buildSettings.MSBuildSettings.Properties["VersionSuffix"] = new[] { $"be.{buildId}" };
|
||||||
TransformText("BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>")
|
buildSettings.MSBuildSettings.Properties["SourceRevisionId"] = new[] { currentCommit };
|
||||||
.WithToken("buildNumber", buildId)
|
buildSettings.MSBuildSettings.Properties["RepositoryBranch"] = new[] { currentBranch };
|
||||||
.WithToken("shortCommit", currentCommit)
|
buildVersion += $"-be.{buildId}+{currentCommitShort}";
|
||||||
.WithToken("branchName", currentBranch)
|
|
||||||
.ToString()
|
|
||||||
};
|
|
||||||
|
|
||||||
buildSettings.MSBuildSettings.Properties["AssemblyVersion"] = new[] { buildVersion + "." + buildId };
|
|
||||||
buildVersion += "-be." + buildId;
|
|
||||||
buildSettings.MSBuildSettings.Properties["Version"] = new[] { buildVersion };
|
|
||||||
} else if (!string.IsNullOrEmpty(customBuildVersion))
|
|
||||||
{
|
|
||||||
buildVersion = customBuildVersion;
|
|
||||||
buildSettings.MSBuildSettings.Properties["Version"] = new[] { buildVersion };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var file in GetFiles("./BepInEx.*/*.csproj")) {
|
foreach (var file in GetFiles("./BepInEx.*/*.csproj")) {
|
||||||
@@ -116,7 +103,7 @@ Task("Build")
|
|||||||
});
|
});
|
||||||
|
|
||||||
const string DOORSTOP_VER = "4.0.0-rc.4";
|
const string DOORSTOP_VER = "4.0.0-rc.4";
|
||||||
const string DOTNET_MINI_VER = "2022.06.15.1";
|
const string DOTNET_MINI_VER = "20220709.38";
|
||||||
const string DOORSTOP_PROXY_DLL = "winhttp.dll";
|
const string DOORSTOP_PROXY_DLL = "winhttp.dll";
|
||||||
const string DOBBY_VER = "1.0.0";
|
const string DOBBY_VER = "1.0.0";
|
||||||
|
|
||||||
@@ -178,7 +165,7 @@ Task("DownloadDependencies")
|
|||||||
|
|
||||||
var dotnetZipPath = depCachePath + File("dotnet-mini.zip");
|
var dotnetZipPath = depCachePath + File("dotnet-mini.zip");
|
||||||
|
|
||||||
DownloadFile($"https://github.com/BepInEx/dotnet-runtime/releases/download/{DOTNET_MINI_VER}/dotnet-mini.zip", dotnetZipPath);
|
DownloadFile($"https://github.com/BepInEx/dotnet-runtime/releases/download/{DOTNET_MINI_VER}/mini-coreclr-Release.zip", dotnetZipPath);
|
||||||
|
|
||||||
ZipUncompress(dotnetZipPath, dotnetPath);
|
ZipUncompress(dotnetZipPath, dotnetPath);
|
||||||
}
|
}
|
||||||
@@ -294,11 +281,10 @@ Task("Pack")
|
|||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var distDir = Directory("./bin/dist");
|
var distDir = Directory("./bin/dist");
|
||||||
var commitSuffix = isBleedingEdge ? $"+{currentCommitShort}" : "";
|
|
||||||
|
|
||||||
Information("Packing BepInEx");
|
Information("Packing BepInEx");
|
||||||
foreach (Target target in targets) {
|
foreach (Target target in targets) {
|
||||||
ZipCompress(distDir + Directory($"{target}"), distDir + File($"BepInEx-{target}-{buildVersion}{commitSuffix}.zip"));
|
ZipCompress(distDir + Directory($"{target}"), distDir + File($"BepInEx-{target}-{buildVersion}.zip"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isBleedingEdge) {
|
if(isBleedingEdge) {
|
||||||
@@ -332,7 +318,7 @@ Task("Pack")
|
|||||||
var cpu => $" {cpu}",
|
var cpu => $" {cpu}",
|
||||||
};
|
};
|
||||||
return new Dictionary<string, object>() {
|
return new Dictionary<string, object>() {
|
||||||
["file"] = $"BepInEx-{target}-{buildVersion}{commitSuffix}.zip",
|
["file"] = $"BepInEx-{target}-{buildVersion}.zip",
|
||||||
["description"] = $"BepInEx {abiName} for {osName}{cpuOsNameSuffix} {abiGamesPrefix}games{osGamesSuffix}",
|
["description"] = $"BepInEx {abiName} for {osName}{cpuOsNameSuffix} {abiGamesPrefix}games{osGamesSuffix}",
|
||||||
};
|
};
|
||||||
}).ToArray(),
|
}).ToArray(),
|
||||||
|
|||||||
@@ -46,4 +46,4 @@ debug_suspend=false
|
|||||||
coreclr_path=dotnet\coreclr.dll
|
coreclr_path=dotnet\coreclr.dll
|
||||||
|
|
||||||
# Path to the directory containing the managed core libraries for CoreCLR (mscorlib, System, etc.)
|
# Path to the directory containing the managed core libraries for CoreCLR (mscorlib, System, etc.)
|
||||||
corlib_dir=dotnet\corlib
|
corlib_dir=dotnet
|
||||||
Reference in new issue
Block a user