Skip to content

Commit 40b56ab

Browse files
committed
Use a props file for setting Version; Build improvements
1 parent 253908a commit 40b56ab

File tree

6 files changed

+65
-63
lines changed

6 files changed

+65
-63
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>BepInEx.KeyboardShortcut.IL2CPP</id>
5+
<version>$version$</version>
6+
<authors>ManlyMarco</authors>
7+
<projectUrl>https://github.com/BepInEx/BepInEx.ConfigurationManager</projectUrl>
8+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
9+
<description>Provides KeyboardShortcut class that is missing in BepInEx 6 (IL2CPP, bleeding edge)</description>
10+
<dependencies>
11+
<group targetFramework="net6.0" />
12+
</dependencies>
13+
</metadata>
14+
</package>

ConfigurationManager.IL2CPP/ConfigurationManager.IL2CPP.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
<DebugType>embedded</DebugType>
1616
<DefineConstants>$(DefineConstants);IL2CPP</DefineConstants>
17-
<Version>18.2.1</Version>
1817
</PropertyGroup>
1918

2019
<ItemGroup>

ConfigurationManager.Shared/ConfigurationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class ConfigurationManager : BaseUnityPlugin
3838
/// <summary>
3939
/// Version constant
4040
/// </summary>
41-
public const string Version = "18.3";
41+
public const string Version = Constants.Version;
4242

4343
internal static ManualLogSource Logger;
4444
private static SettingFieldDrawer _fieldDrawer;

ConfigurationManager.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{F28F879D-0FA8-488C-A696-BDCCD27099B9}"
99
ProjectSection(SolutionItems) = preProject
1010
ConfigurationManagerAttributes.cs = ConfigurationManagerAttributes.cs
11+
Directory.Build.props = Directory.Build.props
1112
EndProjectSection
1213
EndProject
1314
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationManager.IL2CPP", "ConfigurationManager.IL2CPP\ConfigurationManager.IL2CPP.csproj", "{1144B70F-5FF8-4C60-9862-87698157EE1D}"
@@ -52,7 +53,7 @@ Global
5253
EndGlobalSection
5354
GlobalSection(SharedMSBuildProjectFiles) = preSolution
5455
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{1144b70f-5ff8-4c60-9862-87698157ee1d}*SharedItemsImports = 5
55-
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{22edd399-1cc6-47c8-b8b8-a95ff2999901}*SharedItemsImports = 4
56+
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{22edd399-1cc6-47c8-b8b8-a95ff2999901}*SharedItemsImports = 5
5657
ConfigurationManager.Shared\ConfigurationManager.Shared.projitems*{28e965b5-225f-4ad4-938f-2d6f8c20c73f}*SharedItemsImports = 13
5758
EndGlobalSection
5859
EndGlobal
Lines changed: 21 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,34 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{22EDD399-1CC6-47C8-B8B8-A95FF2999901}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
3+
<TargetFramework>net35</TargetFramework>
4+
<ImplicitUsings>disable</ImplicitUsings>
5+
<Nullable>disable</Nullable>
6+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
107
<RootNamespace>ConfigurationManager</RootNamespace>
118
<AssemblyName>ConfigurationManager</AssemblyName>
12-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<NuGetPackageImportStamp>
15-
</NuGetPackageImportStamp>
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<DebugSymbols>true</DebugSymbols>
19-
<DebugType>embedded</DebugType>
20-
<Optimize>false</Optimize>
21-
<OutputPath>..\bin\BepInEx5\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
25-
</PropertyGroup>
26-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
9+
10+
<OutputPath>D:\SVN\BepInEx.ConfigurationManager\bin\BepInEx5</OutputPath>
11+
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
12+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
13+
2714
<DebugType>embedded</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>..\bin\BepInEx5\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
<DebugSymbols>true</DebugSymbols>
34-
<DocumentationFile>..\bin\BepInEx5\ConfigurationManager.xml</DocumentationFile>
15+
<DefineConstants>$(DefineConstants);Mono</DefineConstants>
3516
</PropertyGroup>
17+
3618
<ItemGroup>
37-
<Reference Include="BepInEx, Version=5.4.20.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\BepInEx.BaseLib.5.4.20\lib\net35\BepInEx.dll</HintPath>
39-
<Private>False</Private>
40-
</Reference>
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="Unity.InputSystem, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
44-
<HintPath>..\packages\Unity.InputSystem.1.5.0\lib\net35\Unity.InputSystem.dll</HintPath>
45-
<Private>False</Private>
46-
</Reference>
47-
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
48-
<HintPath>..\packages\UnityEngine.5.6.1\lib\net35\UnityEngine.dll</HintPath>
49-
<Private>False</Private>
50-
</Reference>
51-
</ItemGroup>
52-
<ItemGroup>
53-
<Compile Include="SettingSearcher.cs" />
54-
</ItemGroup>
55-
<ItemGroup>
56-
<None Include="packages.config" />
19+
<PackageReference Include="BepInEx.Analyzers" Version="1.0.8">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
23+
<PackageReference Include="BepInEx.BaseLib" Version="5.4.21" />
24+
<PackageReference Include="Unity.InputSystem" Version="1.5.0" />
25+
<PackageReference Include="UnityEngine" Version="5.6.1" />
5726
</ItemGroup>
27+
5828
<ItemGroup>
5929
<Analyzer Include="..\packages\BepInEx.Analyzers.1.0.8\analyzers\dotnet\cs\BepInEx.Analyzers.CodeFixes.dll" />
6030
<Analyzer Include="..\packages\BepInEx.Analyzers.1.0.8\analyzers\dotnet\cs\BepInEx.Analyzers.dll" />
6131
</ItemGroup>
62-
<ItemGroup>
63-
<Folder Include="Properties\" />
64-
</ItemGroup>
32+
6533
<Import Project="..\ConfigurationManager.Shared\ConfigurationManager.Shared.projitems" Label="Shared" />
66-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
67-
<PropertyGroup>
68-
<PostBuildEvent>IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) KK
69-
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) EC
70-
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) HS
71-
IF EXIST $(SolutionDir)PostBuild.bat CALL "$(SolutionDir)PostBuild.bat" $(TargetPath) AI</PostBuildEvent>
72-
</PropertyGroup>
7334
</Project>

Directory.Build.props

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!-- This is the master version, only change this one -->
4+
<Version>18.3</Version>
5+
</PropertyGroup>
6+
7+
<Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.cs">
8+
<PropertyGroup>
9+
<BepInExPluginVersion Condition="'$(BepInExPluginVersion)' == ''">$(Version)</BepInExPluginVersion>
10+
<GeneratedText><![CDATA[
11+
namespace $(RootNamespace)
12+
{
13+
internal static class Constants
14+
{
15+
public const string Version = "$(BepInExPluginVersion)"%3B
16+
}
17+
}
18+
]]></GeneratedText>
19+
<GeneratedFilePath>$(IntermediateOutputPath)Constants.cs</GeneratedFilePath>
20+
</PropertyGroup>
21+
<ItemGroup>
22+
<Compile Include="$(GeneratedFilePath)" />
23+
<FileWrites Include="$(GeneratedFilePath)" />
24+
</ItemGroup>
25+
<WriteLinesToFile Lines="$(GeneratedText)" File="$(GeneratedFilePath)" WriteOnlyWhenDifferent="true" Overwrite="true" />
26+
</Target>
27+
</Project>

0 commit comments

Comments
 (0)