Skip to content

Commit

Permalink
Use a props file for setting Version; Build improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Oct 1, 2024
1 parent 253908a commit 40b56ab
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 63 deletions.
14 changes: 14 additions & 0 deletions BepInEx.KeyboardShortcut/BepInEx.KeyboardShortcut.IL2CPP.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>BepInEx.KeyboardShortcut.IL2CPP</id>
<version>$version$</version>
<authors>ManlyMarco</authors>
<projectUrl>https://github.com/BepInEx/BepInEx.ConfigurationManager</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Provides KeyboardShortcut class that is missing in BepInEx 6 (IL2CPP, bleeding edge)</description>
<dependencies>
<group targetFramework="net6.0" />
</dependencies>
</metadata>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<DebugType>embedded</DebugType>
<DefineConstants>$(DefineConstants);IL2CPP</DefineConstants>
<Version>18.2.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationManager.Shared/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ConfigurationManager : BaseUnityPlugin
/// <summary>
/// Version constant
/// </summary>
public const string Version = "18.3";
public const string Version = Constants.Version;

internal static ManualLogSource Logger;
private static SettingFieldDrawer _fieldDrawer;
Expand Down
3 changes: 2 additions & 1 deletion ConfigurationManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{F28F879D-0FA8-488C-A696-BDCCD27099B9}"
ProjectSection(SolutionItems) = preProject
ConfigurationManagerAttributes.cs = ConfigurationManagerAttributes.cs
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationManager.IL2CPP", "ConfigurationManager.IL2CPP\ConfigurationManager.IL2CPP.csproj", "{1144B70F-5FF8-4C60-9862-87698157EE1D}"
Expand Down Expand Up @@ -52,7 +53,7 @@ Global
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{1144b70f-5ff8-4c60-9862-87698157ee1d}*SharedItemsImports = 5
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{22edd399-1cc6-47c8-b8b8-a95ff2999901}*SharedItemsImports = 4
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{22edd399-1cc6-47c8-b8b8-a95ff2999901}*SharedItemsImports = 5
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{28e965b5-225f-4ad4-938f-2d6f8c20c73f}*SharedItemsImports = 13
EndGlobalSection
EndGlobal
81 changes: 21 additions & 60 deletions ConfigurationManager/ConfigurationManager.csproj
Original file line number Diff line number Diff line change
@@ -1,73 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{22EDD399-1CC6-47C8-B8B8-A95FF2999901}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFramework>net35</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<RootNamespace>ConfigurationManager</RootNamespace>
<AssemblyName>ConfigurationManager</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\bin\BepInEx5\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

<OutputPath>D:\SVN\BepInEx.ConfigurationManager\bin\BepInEx5</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>True</GenerateDocumentationFile>

<DebugType>embedded</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\BepInEx5\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>..\bin\BepInEx5\ConfigurationManager.xml</DocumentationFile>
<DefineConstants>$(DefineConstants);Mono</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Reference Include="BepInEx, Version=5.4.20.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\BepInEx.BaseLib.5.4.20\lib\net35\BepInEx.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Unity.InputSystem, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Unity.InputSystem.1.5.0\lib\net35\Unity.InputSystem.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\UnityEngine.5.6.1\lib\net35\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="SettingSearcher.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="BepInEx.Analyzers" Version="1.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="BepInEx.BaseLib" Version="5.4.21" />
<PackageReference Include="Unity.InputSystem" Version="1.5.0" />
<PackageReference Include="UnityEngine" Version="5.6.1" />
</ItemGroup>

<ItemGroup>
<Analyzer Include="..\packages\BepInEx.Analyzers.1.0.8\analyzers\dotnet\cs\BepInEx.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\BepInEx.Analyzers.1.0.8\analyzers\dotnet\cs\BepInEx.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<Import Project="..\ConfigurationManager.Shared\ConfigurationManager.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) KK
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) EC
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) HS
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) AI</PostBuildEvent>
</PropertyGroup>
</Project>
27 changes: 27 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<PropertyGroup>
<!-- This is the master version, only change this one -->
<Version>18.3</Version>
</PropertyGroup>

<Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.cs">
<PropertyGroup>
<BepInExPluginVersion Condition="'$(BepInExPluginVersion)' == ''">$(Version)</BepInExPluginVersion>
<GeneratedText><![CDATA[
namespace $(RootNamespace)
{
internal static class Constants
{
public const string Version = "$(BepInExPluginVersion)"%3B
}
}
]]></GeneratedText>
<GeneratedFilePath>$(IntermediateOutputPath)Constants.cs</GeneratedFilePath>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(GeneratedFilePath)" />
<FileWrites Include="$(GeneratedFilePath)" />
</ItemGroup>
<WriteLinesToFile Lines="$(GeneratedText)" File="$(GeneratedFilePath)" WriteOnlyWhenDifferent="true" Overwrite="true" />
</Target>
</Project>

0 comments on commit 40b56ab

Please sign in to comment.