Skip to content

Commit dc09cbd

Browse files
committed
Fully move to new sdk csproj format; Generate zips on release build
1 parent 6946000 commit dc09cbd

File tree

10 files changed

+140
-73
lines changed

10 files changed

+140
-73
lines changed

BepInEx.KeyboardShortcut/BepInEx.KeyboardShortcut.IL2CPP.csproj

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>disable</Nullable>
7-
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
8-
<RootNamespace>BepInEx.KeyboardShortcut</RootNamespace>
5+
6+
<RootNamespace>BepInEx.Configuration</RootNamespace>
97
<AssemblyName>BepInEx.KeyboardShortcut</AssemblyName>
10-
<DebugType>embedded</DebugType>
8+
9+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
10+
<GenerateDependencyFile>false</GenerateDependencyFile>
1111
<GenerateDocumentationFile>True</GenerateDocumentationFile>
12+
13+
<DefineConstants>$(DefineConstants);IL2CPP</DefineConstants>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
17+
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
21+
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
22+
<Optimize>true</Optimize>
1223
</PropertyGroup>
1324

1425
<ItemGroup>
@@ -17,9 +28,11 @@
1728
</PackageReference>
1829
<PackageReference Include="IllusionLibs.HoneyCome.Il2Cppmscorlib" Version="2023.99.12.15">
1930
<IncludeAssets>compile</IncludeAssets>
31+
<PrivateAssets>all</PrivateAssets>
2032
</PackageReference>
2133
<PackageReference Include="IllusionLibs.HoneyCome.UnityEngine" Version="2021.3.14.3">
2234
<IncludeAssets>compile</IncludeAssets>
35+
<PrivateAssets>all</PrivateAssets>
2336
</PackageReference>
2437
</ItemGroup>
2538

BepInEx.KeyboardShortcut/KeyboardShortcut.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// This is copied from BepInEx 5 and modified to work with BepInEx 6 nightlies where this type is missing
22
// This is a temporary fix until this struct is added to BepInEx 6 proper
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
37
using BepInEx.Logging;
48
using System.Reflection;
59
using UnityEngine;

ConfigurationManager.IL2CPP/ConfigurationManager.IL2CPP.csproj

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,60 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<ImplicitUsings>disable</ImplicitUsings>
6-
<Nullable>disable</Nullable>
7-
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
5+
86
<RootNamespace>ConfigurationManager</RootNamespace>
97
<AssemblyName>ConfigurationManager</AssemblyName>
108

11-
<OutputPath>D:\SVN\BepInEx.ConfigurationManager\bin\IL2CPP</OutputPath>
9+
<OutputPath>..\bin\IL2CPP</OutputPath>
1210
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
11+
12+
<GenerateDependencyFile>false</GenerateDependencyFile>
1313
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1414

15-
<DebugType>embedded</DebugType>
1615
<DefineConstants>$(DefineConstants);IL2CPP</DefineConstants>
16+
17+
<ZipPostfix>_IL2CPP</ZipPostfix>
1718
</PropertyGroup>
1819

20+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
21+
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
25+
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
26+
<Optimize>true</Optimize>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<None Include="..\LICENSE">
31+
<Link>LICENSE</Link>
32+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
33+
</None>
34+
<None Include="..\README.md">
35+
<Link>README.md</Link>
36+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
37+
</None>
38+
<None Include="..\ConfigurationManagerAttributes.cs">
39+
<Link>ConfigurationManagerAttributes.cs</Link>
40+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
41+
</None>
42+
</ItemGroup>
43+
1944
<ItemGroup>
2045
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.664">
2146
<IncludeAssets>compile</IncludeAssets>
2247
</PackageReference>
2348
<PackageReference Include="IllusionLibs.HoneyCome.Il2Cppmscorlib" Version="2023.99.12.15">
2449
<IncludeAssets>compile</IncludeAssets>
50+
<PrivateAssets>all</PrivateAssets>
2551
</PackageReference>
2652
<PackageReference Include="IllusionLibs.HoneyCome.UnityEngine" Version="2021.3.14.3">
2753
<IncludeAssets>compile</IncludeAssets>
54+
<PrivateAssets>all</PrivateAssets>
2855
</PackageReference>
2956
<PackageReference Include="IllusionLibs.HoneyCome.UnityEngine.UI" Version="2021.3.14.3">
3057
<IncludeAssets>compile</IncludeAssets>
58+
<PrivateAssets>all</PrivateAssets>
3159
</PackageReference>
3260
</ItemGroup>
3361

ConfigurationManager.Shared/AssemblyInfo.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

ConfigurationManager.Shared/ConfigurationManager.Shared.projitems

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<Import_RootNamespace>ConfigurationManager.Shared</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
1312
<Compile Include="$(MSBuildThisFileDirectory)ConfigSettingEntry.cs" />
1413
<Compile Include="$(MSBuildThisFileDirectory)ConfigurationManager.cs" />
1514
<Compile Include="$(MSBuildThisFileDirectory)PropertySettingEntry.cs" />

ConfigurationManager.Shared/ConfigurationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace ConfigurationManager
2626
/// An easy way to let user configure how a plugin behaves without the need to make your own GUI. The user can change any of the settings you expose, even keyboard shortcuts.
2727
/// https://github.com/ManlyMarco/BepInEx.ConfigurationManager
2828
/// </summary>
29-
[BepInPlugin(GUID, "Configuration Manager", Version)]
29+
[BepInPlugin(GUID, "Configuration Manager", Constants.Version)]
3030
[Browsable(false)]
3131
public class ConfigurationManager : BaseUnityPlugin
3232
{

ConfigurationManager.sln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ VisualStudioVersion = 17.8.34309.116
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigurationManager", "ConfigurationManager\ConfigurationManager.csproj", "{22EDD399-1CC6-47C8-B8B8-A95FF2999901}"
77
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{F28F879D-0FA8-488C-A696-BDCCD27099B9}"
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Solution", "_Solution", "{F28F879D-0FA8-488C-A696-BDCCD27099B9}"
99
ProjectSection(SolutionItems) = preProject
10-
ConfigurationManagerAttributes.cs = ConfigurationManagerAttributes.cs
1110
Directory.Build.props = Directory.Build.props
11+
README.md = README.md
12+
ConfigurationManagerAttributes.cs = ConfigurationManagerAttributes.cs
1213
EndProjectSection
1314
EndProject
1415
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationManager.IL2CPP", "ConfigurationManager.IL2CPP\ConfigurationManager.IL2CPP.csproj", "{1144B70F-5FF8-4C60-9862-87698157EE1D}"
Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,46 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFramework>net35</TargetFramework>
4-
<ImplicitUsings>disable</ImplicitUsings>
5-
<Nullable>disable</Nullable>
6-
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
5+
76
<RootNamespace>ConfigurationManager</RootNamespace>
87
<AssemblyName>ConfigurationManager</AssemblyName>
98

10-
<OutputPath>D:\SVN\BepInEx.ConfigurationManager\bin\BepInEx5</OutputPath>
9+
<OutputPath>..\bin\BepInEx5</OutputPath>
1110
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
11+
12+
<GenerateDependencyFile>false</GenerateDependencyFile>
1213
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1314

14-
<DebugType>embedded</DebugType>
1515
<DefineConstants>$(DefineConstants);Mono</DefineConstants>
16+
17+
<ZipPostfix>_BepInEx5</ZipPostfix>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
21+
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
22+
</PropertyGroup>
23+
24+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
25+
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
26+
<Optimize>true</Optimize>
1627
</PropertyGroup>
1728

29+
<ItemGroup>
30+
<None Include="..\LICENSE">
31+
<Link>LICENSE</Link>
32+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
33+
</None>
34+
<None Include="..\README.md">
35+
<Link>README.md</Link>
36+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
37+
</None>
38+
<None Include="..\ConfigurationManagerAttributes.cs">
39+
<Link>ConfigurationManagerAttributes.cs</Link>
40+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
41+
</None>
42+
</ItemGroup>
43+
1844
<ItemGroup>
1945
<PackageReference Include="BepInEx.Analyzers" Version="1.0.8">
2046
<PrivateAssets>all</PrivateAssets>
@@ -25,9 +51,11 @@
2551
</PackageReference>
2652
<PackageReference Include="Unity.InputSystem" Version="1.5.0">
2753
<IncludeAssets>compile</IncludeAssets>
54+
<PrivateAssets>all</PrivateAssets>
2855
</PackageReference>
2956
<PackageReference Include="UnityEngine" Version="5.6.1">
3057
<IncludeAssets>compile</IncludeAssets>
58+
<PrivateAssets>all</PrivateAssets>
3159
</PackageReference>
3260
</ItemGroup>
3361

@@ -37,4 +65,5 @@
3765
</ItemGroup>
3866

3967
<Import Project="..\ConfigurationManager.Shared\ConfigurationManager.Shared.projitems" Label="Shared" />
68+
4069
</Project>

Directory.Build.props

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,56 @@
22
<PropertyGroup>
33
<!-- This is the master version, only change this one -->
44
<Version>18.4</Version>
5+
6+
<!-- Sets the 'Product name' field on the dll file -->
7+
<Product>BepInEx.ConfigurationManager</Product>
8+
<!-- Sets the 'File description' field on the dll file -->
9+
<AssemblyTitle>Universal in-game configuration manager for BepInEx plugins</AssemblyTitle>
10+
<!-- Sets the 'Company' field on the dll file -->
11+
<Authors>https://github.com/BepInEx/BepInEx.ConfigurationManager</Authors>
12+
<!-- Sets the 'Copyright' field on the dll file -->
13+
<Copyright>Copyright © 2019 / LGPL-3.0</Copyright>
14+
15+
<Deterministic>true</Deterministic>
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>embedded</DebugType>
18+
<FileAlignment>512</FileAlignment>
19+
20+
<ImplicitUsings>disable</ImplicitUsings>
21+
<Nullable>disable</Nullable>
522
</PropertyGroup>
623

7-
<Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.cs">
24+
<!-- Create a release zip file (after successful Release build) -->
25+
<Target Name="CreateReleaseZip" AfterTargets="Build" Condition="'$(Configuration)' == 'Release' And '$(AssemblyName)' == 'ConfigurationManager'">
26+
<PropertyGroup>
27+
<CopyDir>$(OutputPath)\..\TEMP_COPY_$(AssemblyName)</CopyDir>
28+
</PropertyGroup>
29+
<ItemGroup>
30+
<BuildFiles Include="$(OutputPath)\*"/>
31+
</ItemGroup>
32+
33+
<RemoveDir Directories="$(CopyDir)" />
34+
<Copy DestinationFolder="$(CopyDir)\BepInEx\plugins\ConfigurationManager" SourceFiles="@(BuildFiles)" />
35+
<!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/zipdirectory-task?view=vs-2022 -->
36+
<ZipDirectory SourceDirectory="$(CopyDir)" DestinationFile="$(OutputPath)\..\BepInEx.ConfigurationManager$(ZipPostfix)_v$(Version).zip" Overwrite="true" />
37+
<RemoveDir Directories="$(CopyDir)" />
38+
</Target>
39+
40+
<!-- Allow using of the csproj properties defined above in the code itself -->
41+
<Target Name="AddGeneratedConstantsFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedConstantsFile.cs">
842
<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
43+
<GeneratedText>
44+
<![CDATA[namespace $(RootNamespace) {
45+
internal static class Constants {
46+
public const string Version = "$(Version)"%3B
47+
public const string Name = "$(Product)"%3B
48+
public const string Description = "$(AssemblyTitle)"%3B
49+
public const string Website = "$(Authors)"%3B
50+
public const string Copyright = "$(Copyright)"%3B
1651
}
17-
}
18-
]]></GeneratedText>
19-
<GeneratedFilePath>$(IntermediateOutputPath)Constants.cs</GeneratedFilePath>
52+
}]]>
53+
</GeneratedText>
54+
<GeneratedFilePath>$(IntermediateOutputPath)GeneratedConstantsFile.cs</GeneratedFilePath>
2055
</PropertyGroup>
2156
<ItemGroup>
2257
<Compile Include="$(GeneratedFilePath)" />

release.ps1

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)