From 9cfc06ef463876e0f463f6f9a84c92d7ac346989 Mon Sep 17 00:00:00 2001 From: kohanis Date: Wed, 12 Jun 2024 00:28:51 +0300 Subject: [PATCH] Migrate to sdk-style projects (#894) --- .editorconfig | 82 ++++++ .gitignore | 247 ++++++++++++++++-- BepInEx.Bootstrap/BepInEx.Bootstrap.csproj | 49 +--- BepInEx.Bootstrap/Properties/AssemblyInfo.cs | 31 +-- BepInEx.Patcher/BepInEx.Patcher.csproj | 86 ++---- BepInEx.Patcher/ILRepack.targets | 18 +- BepInEx.Patcher/Properties/AssemblyInfo.cs | 31 +-- BepInEx.Patcher/packages.config | 7 - BepInEx.Preloader/BepInEx.Preloader.csproj | 110 ++------ BepInEx.Preloader/Properties/AssemblyInfo.cs | 28 +- .../RuntimeFixes/HarmonyInteropFix.cs | 7 +- BepInEx.Preloader/packages.config | 7 - BepInEx.sln | 25 +- BepInEx.sln.DotSettings | 217 --------------- BepInEx/BepInEx.csproj | 160 +++--------- BepInEx/Properties/AssemblyInfo.cs | 30 +-- BepInEx/packages.config | 8 - BepInExTests/BepInExTests.csproj | 134 ++-------- BepInExTests/Properties/AssemblyInfo.cs | 29 +- BepInExTests/packages.config | 6 - Directory.Build.props | 5 + build.cake | 37 ++- build.sh | 2 +- submodules/BepInEx.Harmony | 2 +- 24 files changed, 490 insertions(+), 868 deletions(-) create mode 100644 .editorconfig delete mode 100644 BepInEx.Patcher/packages.config delete mode 100644 BepInEx.Preloader/packages.config delete mode 100644 BepInEx.sln.DotSettings delete mode 100644 BepInEx/packages.config delete mode 100644 BepInExTests/packages.config create mode 100644 Directory.Build.props diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..dcedec2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,82 @@ +[*] +charset = utf-8 +end_of_line = crlf +trim_trailing_whitespace = false +insert_final_newline = false +indent_style = space +indent_size = 4 + +# Microsoft .NET properties +csharp_new_line_before_members_in_object_initializers = false +csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_var_elsewhere = true:suggestion +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True +dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field +dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef +dotnet_naming_rule.unity_serialized_field_rule.severity = warning +dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style +dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols +dotnet_naming_style.lower_camel_case_style.capitalization = camel_case +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = * +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds = +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance +dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none +dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion +dotnet_style_qualification_for_event = false:suggestion +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion + +# ReSharper properties +resharper_align_multiline_calls_chain = true +resharper_autodetect_indent_settings = true +resharper_csharp_alignment_tab_fill_style = optimal_fill +resharper_csharp_empty_block_style = together_same_line +resharper_csharp_indent_style = tab +resharper_csharp_wrap_lines = false +resharper_formatter_off_tag = @formatter:off +resharper_formatter_on_tag = @formatter:on +resharper_formatter_tags_enabled = true +resharper_for_built_in_types = use_var_when_evident +resharper_indent_nested_foreach_stmt = true +resharper_indent_nested_for_stmt = true +resharper_indent_nested_while_stmt = true +resharper_indent_preprocessor_directives = normal +resharper_keep_existing_embedded_arrangement = false +resharper_place_accessorholder_attribute_on_same_line = false +resharper_place_accessor_attribute_on_same_line = false +resharper_place_field_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = false +resharper_use_indent_from_vs = false + +# ReSharper inspection severities +resharper_arrange_redundant_parentheses_highlighting = hint +resharper_arrange_this_qualifier_highlighting = hint +resharper_arrange_type_member_modifiers_highlighting = hint +resharper_arrange_type_modifiers_highlighting = hint +resharper_built_in_type_reference_style_for_member_access_highlighting = hint +resharper_built_in_type_reference_style_highlighting = hint +resharper_razor_assembly_not_resolved_highlighting = warning +resharper_redundant_base_qualifier_highlighting = warning +resharper_suggest_var_or_type_built_in_types_highlighting = hint +resharper_suggest_var_or_type_elsewhere_highlighting = hint +resharper_suggest_var_or_type_simple_types_highlighting = hint +resharper_web_config_module_not_resolved_highlighting = warning +resharper_web_config_type_not_resolved_highlighting = warning +resharper_web_config_wrong_module_highlighting = warning + +[*.cs] +indent_style = tab +indent_size = tab +tab_width = 4 + +[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}] +tab_width = 4 diff --git a/.gitignore b/.gitignore index 205e69a..fdc8018 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,13 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Get latest from `dotnet new gitignore` + +# dotenv files +.env # User-specific files +*.rsuser *.suo *.user *.userosscache @@ -12,6 +16,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -19,43 +26,65 @@ [Rr]eleases/ x64/ x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +[Ll]ogs/ -# Visual Studio 2015 cache/options directory +# Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ +# Visual Studio 2017 auto generated files +Generated\ Files/ + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c -# .NET Core +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET project.lock.json project.fragment.lock.json artifacts/ -**/Properties/launchSettings.json +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio *_i.c *_p.c -*_i.h +*_h.h *.ilk *.meta *.obj +*.iobj *.pch *.pdb +*.ipdb *.pgc *.pgd *.rsp @@ -65,7 +94,9 @@ artifacts/ *.tlh *.tmp *.tmp_proj +*_wpftmp.csproj *.log +*.tlog *.vspscc *.vssscc .builds @@ -93,6 +124,9 @@ ipch/ *.vspx *.sap +# Visual Studio Trace Files +*.e2e + # TFS 2012 Local Workspace $tf/ @@ -104,15 +138,21 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + # Visual Studio code coverage results *.coverage *.coveragexml @@ -148,7 +188,7 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings +# Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj @@ -160,12 +200,14 @@ PublishScripts/ # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore -**/packages/* +**/[Pp]ackages/* # except build/, which is used as an MSBuild target. -!**/packages/build/ +!**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config +#!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets @@ -183,12 +225,15 @@ AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt +*.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache -!*.[Cc]ache/ +!?*.[Cc]ache/ # Others ClientBin/ @@ -201,6 +246,10 @@ ClientBin/ *.publishsettings orleans.codegen.cs +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ @@ -215,6 +264,8 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak # SQL Server files *.mdf @@ -225,6 +276,10 @@ UpgradeLog*.htm *.rdl.data *.bim.layout *.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ @@ -236,9 +291,6 @@ FakesAssemblies/ .ntvs_analysis.dat node_modules/ -# Typescript v1 declaration files -typings/ - # Visual Studio 6 build log *.plg @@ -248,6 +300,17 @@ typings/ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts @@ -263,20 +326,19 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ +# CodeRush personal settings +.cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config +tools/** +!tools/packages.config + +# Tabs Studio +*.tss # Telerik's JustMock configuration file *.jmconfig @@ -287,5 +349,136 @@ __pycache__/ *.odx.cs *.xsd.cs -# Cake binaries -tools/ +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +.idea + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# Vim temporary swap files +*.swp diff --git a/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj b/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj index 856be7b..23a7a38 100644 --- a/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj +++ b/BepInEx.Bootstrap/BepInEx.Bootstrap.csproj @@ -1,40 +1,11 @@ - - - - - Debug - AnyCPU - {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB} - Library - Properties - BepInEx.Bootstrap - BepInEx.Bootstrap - v3.5 - 512 - - - none - true - ..\bin\patcher\ - TRACE - prompt - 4 - - - - - - - - - - - - - {4ffba620-f5ed-47f9-b90c-dad1316fd9b9} - BepInEx - False - - - + + + BepInEx.Bootstrap + net35 + 1.0.0.0 + + + + + \ No newline at end of file diff --git a/BepInEx.Bootstrap/Properties/AssemblyInfo.cs b/BepInEx.Bootstrap/Properties/AssemblyInfo.cs index ba1b63c..45b7940 100644 --- a/BepInEx.Bootstrap/Properties/AssemblyInfo.cs +++ b/BepInEx.Bootstrap/Properties/AssemblyInfo.cs @@ -1,18 +1,4 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BepInEx.Bootstrap")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BepInEx.Bootstrap")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -20,17 +6,4 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6e6bc1e5-5be8-4566-b3ae-52c4cb218aeb")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: Guid("6e6bc1e5-5be8-4566-b3ae-52c4cb218aeb")] \ No newline at end of file diff --git a/BepInEx.Patcher/BepInEx.Patcher.csproj b/BepInEx.Patcher/BepInEx.Patcher.csproj index 8d7de82..aa28c4a 100644 --- a/BepInEx.Patcher/BepInEx.Patcher.csproj +++ b/BepInEx.Patcher/BepInEx.Patcher.csproj @@ -1,61 +1,31 @@ - - - - - - Debug - AnyCPU - {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7} - Exe - BepInEx.Patcher - BepInEx.Patcher - v3.5 - 512 - true - - - - - - BepInEx.Patcher.Program - - - true - ..\bin\patcher\ - TRACE - true - embedded - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - - $(SolutionDir)\packages\Mono.Cecil.0.10.3\lib\net35\Mono.Cecil.dll - - - - - - - - - - - - - - - - - - - + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + BepInEx.Patcher + Copyright © Bepis 2018 + net35 + Exe + 5.0.0.0 - - - - + + + true + embedded + + + + BepInEx.Patcher.Program + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BepInEx.Patcher/ILRepack.targets b/BepInEx.Patcher/ILRepack.targets index 071b3b5..0b5ce62 100644 --- a/BepInEx.Patcher/ILRepack.targets +++ b/BepInEx.Patcher/ILRepack.targets @@ -2,8 +2,7 @@ - - + @@ -11,16 +10,23 @@ - - + + + + + + + + + + \ No newline at end of file diff --git a/BepInEx.Patcher/Properties/AssemblyInfo.cs b/BepInEx.Patcher/Properties/AssemblyInfo.cs index 1df26b3..b2c3229 100644 --- a/BepInEx.Patcher/Properties/AssemblyInfo.cs +++ b/BepInEx.Patcher/Properties/AssemblyInfo.cs @@ -1,18 +1,4 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BepInEx.Patcher")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BepInEx.Patcher")] -[assembly: AssemblyCopyright("Copyright © Bepis 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -20,17 +6,4 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dc89f18b-235b-4c01-ab31-af40dce5c4c7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.0.0.0")] -[assembly: AssemblyFileVersion("5.0.0.0")] \ No newline at end of file +[assembly: Guid("dc89f18b-235b-4c01-ab31-af40dce5c4c7")] \ No newline at end of file diff --git a/BepInEx.Patcher/packages.config b/BepInEx.Patcher/packages.config deleted file mode 100644 index 68b8c20..0000000 --- a/BepInEx.Patcher/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/BepInEx.Preloader/BepInEx.Preloader.csproj b/BepInEx.Preloader/BepInEx.Preloader.csproj index 125143d..f054cf3 100644 --- a/BepInEx.Preloader/BepInEx.Preloader.csproj +++ b/BepInEx.Preloader/BepInEx.Preloader.csproj @@ -1,82 +1,30 @@ - - - - - Debug - AnyCPU - {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA} - Library - Properties - BepInEx.Preloader - BepInEx.Preloader - v3.5 - 512 - true - - - none - true - ..\bin\ - TRACE - prompt - 4 - ..\bin\BepInEx.Preloader.xml - - - - $(SolutionDir)\packages\HarmonyX.2.9.0\lib\net35\0Harmony.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Mdb.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Pdb.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Rocks.dll - - - $(SolutionDir)\packages\MonoMod.RuntimeDetour.22.1.29.1\lib\net35\MonoMod.RuntimeDetour.dll - True - - - $(SolutionDir)\packages\MonoMod.Utils.22.1.29.1\lib\net35\MonoMod.Utils.dll - True - - - - - - - - - - - - - - - - - - - - - - {4ffba620-f5ed-47f9-b90c-dad1316fd9b9} - BepInEx - - - {160f7fe0-288d-435c-9e7e-497d3e0de3a6} - HarmonyXInterop - - - - - - + + + BepInEx.Preloader + Copyright © Bepis 2019 + net35 + true + true + $(BepInExVersionPrefix) + $(BepInExVersionSuffix) + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BepInEx.Preloader/Properties/AssemblyInfo.cs b/BepInEx.Preloader/Properties/AssemblyInfo.cs index 49567e3..23b7fbd 100644 --- a/BepInEx.Preloader/Properties/AssemblyInfo.cs +++ b/BepInEx.Preloader/Properties/AssemblyInfo.cs @@ -1,17 +1,4 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BepInEx.Preloader")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BepInEx.Preloader")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -20,16 +7,3 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("f7abbe07-c02f-4f7c-bf6e-c6656bf588ca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.4.23.2")] -[assembly: AssemblyFileVersion("5.4.23.2")] \ No newline at end of file diff --git a/BepInEx.Preloader/RuntimeFixes/HarmonyInteropFix.cs b/BepInEx.Preloader/RuntimeFixes/HarmonyInteropFix.cs index 9ce61ea..236e53e 100644 --- a/BepInEx.Preloader/RuntimeFixes/HarmonyInteropFix.cs +++ b/BepInEx.Preloader/RuntimeFixes/HarmonyInteropFix.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; +using System.Reflection; using BepInEx.Bootstrap; using BepInEx.Logging; using HarmonyLib; @@ -14,7 +11,7 @@ namespace BepInEx.Preloader.RuntimeFixes public static void Apply() { HarmonyInterop.Initialize(Paths.CachePath); - Harmony.CreateAndPatchAll(typeof(HarmonyInteropFix), "org.bepinex.fixes.harmonyinterop"); + HarmonyLib.Harmony.CreateAndPatchAll(typeof(HarmonyInteropFix), "org.bepinex.fixes.harmonyinterop"); } [HarmonyReversePatch] diff --git a/BepInEx.Preloader/packages.config b/BepInEx.Preloader/packages.config deleted file mode 100644 index 5514bf3..0000000 --- a/BepInEx.Preloader/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/BepInEx.sln b/BepInEx.sln index ddef28b..60a116b 100644 --- a/BepInEx.sln +++ b/BepInEx.sln @@ -6,10 +6,6 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx", "BepInEx\BepInEx.csproj", "{4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx.Patcher", "BepInEx.Patcher\BepInEx.Patcher.csproj", "{DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}" - ProjectSection(ProjectDependencies) = postProject - {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9} = {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9} - {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB} = {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB} - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx.Bootstrap", "BepInEx.Bootstrap\BepInEx.Bootstrap.csproj", "{6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}" EndProject @@ -22,9 +18,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInEx.Preloader", "BepInEx.Preloader\BepInEx.Preloader.csproj", "{F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BepInExTests", "BepInExTests\BepInExTests.csproj", "{E7CD429A-D057-48E3-8C51-E5C934E8E07B}" - ProjectSection(ProjectDependencies) = postProject - {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9} = {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9} - EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HarmonyXInterop", "submodules\BepInEx.Harmony\HarmonyXInterop\HarmonyXInterop.csproj", "{160F7FE0-288D-435C-9E7E-497D3E0DE3A6}" EndProject @@ -40,25 +33,22 @@ Global {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9}.Release|Any CPU.Build.0 = Release|Any CPU - {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Debug|Any CPU.Build.0 = Release|Any CPU {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Release|Any CPU.Build.0 = Release|Any CPU - {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Debug|Any CPU.Build.0 = Release|Any CPU + {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC89F18B-235B-4C01-AB31-AF40DCE5C4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Release|Any CPU.Build.0 = Release|Any CPU + {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E6BC1E5-5BE8-4566-B3AE-52C4CB218AEB}.Debug|Any CPU.Build.0 = Debug|Any CPU {54161CFE-FF42-4DDE-B161-3A49545DB5CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {54161CFE-FF42-4DDE-B161-3A49545DB5CD}.Debug|Any CPU.Build.0 = Debug|Any CPU {54161CFE-FF42-4DDE-B161-3A49545DB5CD}.Release|Any CPU.ActiveCfg = Release|Any CPU {54161CFE-FF42-4DDE-B161-3A49545DB5CD}.Release|Any CPU.Build.0 = Release|Any CPU - {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Debug|Any CPU.Build.0 = Release|Any CPU {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Release|Any CPU.Build.0 = Release|Any CPU - {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Debug|Any CPU.ActiveCfg = Debug|x86 - {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Debug|Any CPU.Build.0 = Debug|x86 - {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Release|Any CPU.ActiveCfg = Release|x86 + {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7ABBE07-C02F-4F7C-BF6E-C6656BF588CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {160F7FE0-288D-435C-9E7E-497D3E0DE3A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {160F7FE0-288D-435C-9E7E-497D3E0DE3A6}.Debug|Any CPU.Build.0 = Debug|Any CPU {160F7FE0-288D-435C-9E7E-497D3E0DE3A6}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -67,6 +57,9 @@ Global {69F6541D-A0F5-419D-B0EE-F5017F1D34F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {69F6541D-A0F5-419D-B0EE-F5017F1D34F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {69F6541D-A0F5-419D-B0EE-F5017F1D34F3}.Release|Any CPU.Build.0 = Release|Any CPU + {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7CD429A-D057-48E3-8C51-E5C934E8E07B}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BepInEx.sln.DotSettings b/BepInEx.sln.DotSettings deleted file mode 100644 index dcdeee3..0000000 --- a/BepInEx.sln.DotSettings +++ /dev/null @@ -1,217 +0,0 @@ - - True - Insert - Built-in: Reformat Code - True - OPTIMAL_FILL - TOGETHER_SAME_LINE - True - True - True - Tab - False - NEVER - NEVER - NEVER - NEVER - False - True - False - False - <?xml version="1.0" encoding="utf-16"?> -<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> - <TypePattern DisplayName="Non-reorderable types"> - <TypePattern.Match> - <Or> - <And> - <Kind Is="Interface" /> - <Or> - <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> - <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> - </Or> - </And> - <Kind Is="Struct" /> - <HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" /> - <HasAttribute Name="JetBrains.Annotations.NoReorder" /> - </Or> - </TypePattern.Match> - </TypePattern> - <TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <HasMember> - <And> - <Kind Is="Method" /> - <HasAttribute Name="Xunit.FactAttribute" Inherited="True" /> - </And> - </HasMember> - </And> - </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> - <Entry.Match> - <Or> - <Kind Is="Constructor" /> - <And> - <Kind Is="Method" /> - <ImplementsInterface Name="System.IDisposable" /> - </And> - </Or> - </Entry.Match> - <Entry.SortBy> - <Kind Order="Constructor" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="All other members" /> - <Entry Priority="100" DisplayName="Test Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <HasAttribute Name="Xunit.FactAttribute" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - </TypePattern> - <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> - <TypePattern.Match> - <And> - <Kind Is="Class" /> - <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> - </And> - </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <Or> - <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> - <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> - </Or> - </And> - </Entry.Match> - </Entry> - <Entry DisplayName="All other members" /> - <Entry Priority="100" DisplayName="Test Methods"> - <Entry.Match> - <And> - <Kind Is="Method" /> - <HasAttribute Name="NUnit.Framework.TestAttribute" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - </TypePattern> - <TypePattern DisplayName="Default Pattern"> - <Entry DisplayName="Static Fields and Constants"> - <Entry.Match> - <Or> - <Kind Is="Constant" /> - <And> - <Kind Is="Field" /> - <Static /> - </And> - </Or> - </Entry.Match> - <Entry.SortBy> - <Kind Order="Constant Field" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Fields"> - <Entry.Match> - <And> - <Kind Is="Field" /> - <Not> - <Static /> - </Not> - </And> - </Entry.Match> - <Entry.SortBy> - <Readonly /> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="100" DisplayName="Public Delegates"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Delegate" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - <Entry Priority="100" DisplayName="Public Enums"> - <Entry.Match> - <And> - <Access Is="Public" /> - <Kind Is="Enum" /> - </And> - </Entry.Match> - <Entry.SortBy> - <Name /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="Properties, Indexers"> - <Entry.Match> - <Or> - <Kind Is="Property" /> - <Kind Is="Indexer" /> - </Or> - </Entry.Match> - </Entry> - <Entry DisplayName="Constructors"> - <Entry.Match> - <Kind Is="Constructor" /> - </Entry.Match> - <Entry.SortBy> - <Static /> - </Entry.SortBy> - </Entry> - <Entry Priority="100" DisplayName="Interface Implementations"> - <Entry.Match> - <And> - <Kind Is="Member" /> - <ImplementsInterface /> - </And> - </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="True" /> - </Entry.SortBy> - </Entry> - <Entry DisplayName="All other members" /> - <Entry DisplayName="Nested Types"> - <Entry.Match> - <Kind Is="Type" /> - </Entry.Match> - </Entry> - </TypePattern> -</Patterns> - UseVarWhenEvident - False - False - True - Skip - False - False - True - False - False - True - - True - 1 - True - True - True - True - True - True - True \ No newline at end of file diff --git a/BepInEx/BepInEx.csproj b/BepInEx/BepInEx.csproj index 715951f..3451f39 100644 --- a/BepInEx/BepInEx.csproj +++ b/BepInEx/BepInEx.csproj @@ -1,135 +1,43 @@ - - - + - Debug - AnyCPU - {4FFBA620-F5ED-47F9-B90C-DAD1316FD9B9} - Library - BepInEx - BepInEx - v3.5 - 512 - true - - - - AnyCPU - none - true - ..\bin\ - TRACE - prompt - 4 - ..\bin\BepInEx.xml - true - - - - - - bin\Debug\ - TRACE;DEBUG - - - false - x86 - prompt - MinimumRecommendedRules.ruleset - full - true - true + BepInEx + Unity plugin injection framework + Copyright © Bepis 2018 + net35 + true + true + $(BepInExVersionPrefix) + $(BepInExVersionSuffix) + - - $(SolutionDir)\packages\HarmonyX.2.9.0\lib\net35\0Harmony.dll - True - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Mdb.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Pdb.dll - - - $(SolutionDir)\packages\Mono.Cecil.0.10.4\lib\net35\Mono.Cecil.Rocks.dll - - - $(SolutionDir)\packages\MonoMod.RuntimeDetour.22.1.29.1\lib\net35\MonoMod.RuntimeDetour.dll - True - - - $(SolutionDir)\packages\MonoMod.Utils.22.1.29.1\lib\net35\MonoMod.Utils.dll - True - - - - ..\packages\UnityEngine.5.6.1\lib\net35\UnityEngine.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - {54161cfe-ff42-4dde-b161-3a49545db5cd} - BepInEx.Harmony + false + Content + PreserveNewest + Build;DocumentationProjectOutputGroup + + + false + Content + PreserveNewest + Build + - + + + + + - - + + + + + + + \ No newline at end of file diff --git a/BepInEx/Properties/AssemblyInfo.cs b/BepInEx/Properties/AssemblyInfo.cs index 4aa2206..582350a 100644 --- a/BepInEx/Properties/AssemblyInfo.cs +++ b/BepInEx/Properties/AssemblyInfo.cs @@ -1,20 +1,5 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// ReSharper disable once RedundantUsingDirective -using BepInEx; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BepInEx")] -[assembly: AssemblyDescription("Unity plugin injection framework")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BepInEx")] -[assembly: AssemblyCopyright("Copyright © Bepis 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -26,16 +11,3 @@ using BepInEx; [assembly: InternalsVisibleTo("BepInEx.Preloader")] [assembly: InternalsVisibleTo("BepInExTests")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.4.23.2")] -[assembly: AssemblyFileVersion("5.4.23.2")] \ No newline at end of file diff --git a/BepInEx/packages.config b/BepInEx/packages.config deleted file mode 100644 index 5ab1f45..0000000 --- a/BepInEx/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/BepInExTests/BepInExTests.csproj b/BepInExTests/BepInExTests.csproj index ed60c24..0233b79 100644 --- a/BepInExTests/BepInExTests.csproj +++ b/BepInExTests/BepInExTests.csproj @@ -1,116 +1,36 @@ - - - - - Debug - AnyCPU - {E7CD429A-D057-48E3-8C51-E5C934E8E07B} - Library - Properties - BepInExTests - BepInExTests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - - - - 15.0 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - - - - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll - - - ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll - - - - ..\packages\UnityEngine.5.6.1\lib\net35\UnityEngine.dll - - - - - - - - - - - - - - - - - - - - - {4ffba620-f5ed-47f9-b90c-dad1316fd9b9} - BepInEx - - - - - + + + net45 + + + + + + + + + + + + + + + + + + + - False + False - False + False - False + False - False + False - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - + \ No newline at end of file diff --git a/BepInExTests/Properties/AssemblyInfo.cs b/BepInExTests/Properties/AssemblyInfo.cs index 1487903..5a13d93 100644 --- a/BepInExTests/Properties/AssemblyInfo.cs +++ b/BepInExTests/Properties/AssemblyInfo.cs @@ -1,18 +1,4 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BepInExTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BepInExTests")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +using System.Runtime.InteropServices; // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from @@ -21,16 +7,3 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e7cd429a-d057-48e3-8c51-e5c934e8e07b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BepInExTests/packages.config b/BepInExTests/packages.config deleted file mode 100644 index 66315dd..0000000 --- a/BepInExTests/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..edfbc7c --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + 5.4.23.2 + + diff --git a/build.cake b/build.cake index 0d7f6e1..3d0f204 100644 --- a/build.cake +++ b/build.cake @@ -1,8 +1,8 @@ -#addin nuget:?package=Cake.FileHelpers&version=4.0.1 -#addin nuget:?package=SharpZipLib&version=1.3.1 -#addin nuget:?package=Cake.Compression&version=0.2.6 -#addin nuget:?package=Cake.Json&version=6.0.1 -#addin nuget:?package=Newtonsoft.Json&version=13.0.1 +#addin nuget:?package=Cake.FileHelpers&version=5.0.0 +#addin nuget:?package=SharpZipLib&version=1.4.2 +#addin nuget:?package=Cake.Compression&version=0.3.0 +#addin nuget:?package=Cake.Json&version=7.0.1 +#addin nuget:?package=Newtonsoft.Json&version=13.0.3 const string DOORSTOP_VER = "4.3.0"; @@ -45,7 +45,7 @@ Task("PullDependencies") StartProcess("git", "submodule update --init --recursive"); Information("Restoring NuGet packages"); - NuGetRestore("./BepInEx.sln"); + DotNetRestore("./BepInEx.sln"); }); Task("Build") @@ -55,26 +55,35 @@ Task("Build") { var bepinExProperties = Directory("./BepInEx/Properties"); + buildVersion = FindRegexMatchGroupInFile(File("Directory.Build.props"), "(.+?)<\\/BepInExVersionPrefix>", 1, System.Text.RegularExpressions.RegexOptions.None).Value; + + var settings = new DotNetPublishSettings + { + Configuration = "Release", + }; + if(isBleedingEdge) { + settings.MSBuildSettings = new DotNetMSBuildSettings().WithProperty("BepInExVersionSuffix", "be." + buildId); + + buildVersion = buildVersion + "-be." + buildId; + CopyFile(bepinExProperties + File("AssemblyInfo.cs"), bepinExProperties + File("AssemblyInfo.cs.bak")); - ReplaceRegexInFiles(bepinExProperties + File("AssemblyInfo.cs"), "([0-9]+\\.[0-9]+\\.[0-9]+\\.)[0-9]+", "${1}" + buildId); FileAppendText(bepinExProperties + File("AssemblyInfo.cs"), - TransformText("\n[assembly: BuildInfo(\"BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>\")]\n") + TransformText("\n[assembly: BepInEx.BuildInfo(\"BLEEDING EDGE Build #<%buildNumber%> from <%shortCommit%> at <%branchName%>\")]\n") .WithToken("buildNumber", buildId) .WithToken("shortCommit", currentCommit) .WithToken("branchName", currentBranch) .ToString()); } - buildVersion = FindRegexMatchInFile(bepinExProperties + File("AssemblyInfo.cs"), "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+", System.Text.RegularExpressions.RegexOptions.None); - var buildSettings = new MSBuildSettings { - Configuration = "Release", - Restore = true - }; - MSBuild("./BepInEx.sln", buildSettings); + settings.OutputDirectory = "./bin/"; + DotNetPublish("./BepInEx.Preloader/BepInEx.Preloader.csproj", settings); + + settings.OutputDirectory = "./bin/patcher/"; + DotNetPublish("./BepInEx.Patcher/BepInEx.Patcher.csproj", settings); }) .Finally(() => { diff --git a/build.sh b/build.sh index 1d0e17c..31be886 100644 --- a/build.sh +++ b/build.sh @@ -9,4 +9,4 @@ export DOTNET_NOLOGO=1 dotnet tool restore -dotnet cake $@ +dotnet cake "$@" diff --git a/submodules/BepInEx.Harmony b/submodules/BepInEx.Harmony index 0d24abf..d4cdcb4 160000 --- a/submodules/BepInEx.Harmony +++ b/submodules/BepInEx.Harmony @@ -1 +1 @@ -Subproject commit 0d24abfed64596ee88b4242b9c7e3daa849d6d28 +Subproject commit d4cdcb4cdeac14a0b77012165f5f5a9f5032a9fa