Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging upstream #97

Merged
merged 210 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
61454b6
- Improve performance of `FindReplacement` by maintaining a new field…
simplyWiri Dec 2, 2021
0e5dbc7
- Improve test cases around retrieving patch methods from patches.
simplyWiri Dec 2, 2021
ce0a477
Fix Unpatch(MethodBase, HarmonyPatchType, string) overload default
Windows10CE Mar 22, 2022
58b3acd
Merge pull request #465 from Windows10CE/master
pardeike Mar 23, 2022
f366a30
Update documentation [skip ci]
pardeike-bot Mar 23, 2022
2c4ddf0
SymbolExtensions.GetMethodInfo allow parameterless method decoding
mitchcapper Apr 22, 2022
f99da83
tests bug report #473
pardeike Apr 23, 2022
1f9aa13
excludes Core3 test for x86
pardeike Apr 23, 2022
41e8328
also core 3.1
pardeike Apr 23, 2022
2ed8f67
reverts changes
pardeike Apr 23, 2022
095487c
Merge pull request #472 from mitchcapper/getmethodinfo_parameterless_…
pardeike Apr 24, 2022
646c965
Update documentation [skip ci]
pardeike-bot Apr 24, 2022
d420fd5
refactors to latest language 10 features
pardeike Apr 24, 2022
9ddbd0b
Update documentation [skip ci]
pardeike-bot Apr 24, 2022
6f1f575
refactors to latest language 10 features
pardeike Apr 24, 2022
85f2f30
merge
pardeike Apr 24, 2022
4a82d0f
Update documentation [skip ci]
pardeike-bot Apr 24, 2022
93160f8
less supression
pardeike Apr 24, 2022
c7c4f77
updates dotnet url
pardeike Apr 28, 2022
9e5bd5a
adds LoadsConstant(this CodeInstruction code, string str)
pardeike May 3, 2022
2cec085
Update documentation [skip ci]
pardeike-bot May 3, 2022
99586ae
adds first draft of native method patching
pardeike May 5, 2022
56ac45a
Merge branch 'master' of https://github.com/pardeike/Harmony
pardeike May 5, 2022
4d8e540
- Add cache invalidation for methodStarts dictionary
simplyWiri Jan 8, 2022
6b07f0e
Docs - filter exception blocks are unsupported currently
Qkrisi Jun 16, 2022
81229d1
Filter block unsupported clarification
Qkrisi Jun 16, 2022
13b58f4
Merge pull request #485 from Qkrisi/master
pardeike Jun 16, 2022
932bd62
Update documentation [skip ci]
pardeike-bot Jun 16, 2022
dd08355
Merge pull request #437 from simplyWiri/master
pardeike Jun 30, 2022
e65a787
updates MMC to 22.6.3.1, removes marshalling tests due to crashing
pardeike Jun 30, 2022
bb0fa4f
fixes struct returning methods under non-windows
pardeike Jun 30, 2022
89a15f7
Update documentation [skip ci]
pardeike-bot Jun 30, 2022
dcbd265
adds net6 and net7
pardeike Jun 30, 2022
b86008b
disabled even more tests, re-enables parallel tests
pardeike Jul 1, 2022
6115e79
removes net7
pardeike Jul 1, 2022
cc40a5c
removes net7 for real
pardeike Jul 1, 2022
e28e864
uses sdk
pardeike Jul 19, 2022
df8d098
Merge pull request #489 from pardeike/net6-7
pardeike Jul 19, 2022
a5f0ad1
Update documentation [skip ci]
pardeike-bot Jul 19, 2022
d1aa13b
adds linux support for struct return buffer checks, adds lambda to Co…
pardeike Jul 19, 2022
5a48778
Update documentation [skip ci]
pardeike-bot Jul 19, 2022
2377372
Update issue templates
pardeike Jul 21, 2022
7a241fd
Add [HarmonyPatchCategory], PatchCategory, PatchAllUncategorized
rrazgriz Sep 6, 2022
30d5208
add patch class categories/functions to docs
rrazgriz Sep 6, 2022
7c46762
Update intro.html
pardeike Sep 26, 2022
beffadc
Methods for getting indices and making loads and stores
LoganDark Oct 3, 2022
b951db5
CodeMatch helpers for matching loads and stores
LoganDark Oct 3, 2022
679408e
Use the full "Argument" term in method names
LoganDark Oct 4, 2022
5f76f1c
Merge pull request #500 from LoganDark/local-index
pardeike Oct 4, 2022
3fe1b46
Update documentation [skip ci]
pardeike-bot Oct 4, 2022
0255bd1
Add an example for patch factory methods
Meigyoku-Thmn Oct 16, 2022
d0da150
Merge pull request #502 from Meigyoku-Thmn/patch-1
pardeike Oct 16, 2022
40e4820
Update documentation [skip ci]
pardeike-bot Oct 16, 2022
4000e08
adds static modifiers
pardeike Oct 16, 2022
e54dd81
Update documentation [skip ci]
pardeike-bot Oct 16, 2022
db80396
v2.3 implements boxing __instance correctly
pardeike Nov 2, 2022
75ca333
fixes #499 : argument array writing for non ref cases
pardeike Nov 2, 2022
61f4335
Merge pull request #498 from rrazgriz/categories
pardeike Nov 3, 2022
8be4600
Update documentation [skip ci]
pardeike-bot Nov 3, 2022
343a1e3
yet another injector
StackOverflowExcept1on Dec 22, 2022
9fcc73f
Merge pull request #512 from StackOverflowExcept1on/master
pardeike Dec 22, 2022
7541112
Update documentation [skip ci]
pardeike-bot Dec 22, 2022
2eef3d0
Update documentation [skip ci]
pardeike-bot Jan 8, 2023
e2296ce
Adds support for targeting an async method's internal state machine's…
Banane9 Mar 1, 2023
b329cbc
Adapts style and requests
Banane9 Mar 22, 2023
4e50067
Merge pull request #514 from Banane9/master
pardeike Mar 22, 2023
e0f9477
Update documentation [skip ci]
pardeike-bot Mar 22, 2023
d73cf84
Adds targeting indexer properties using Getter/Setter method types wi…
Banane9 Apr 3, 2023
57ba000
Merge branch 'master' of https://github.com/Banane9/Harmony
Banane9 Apr 3, 2023
e37d9ec
Add Delegate overloads and implicit casts to HarmonyMethod; Fixes #505
Banane9 Apr 3, 2023
fc19016
Merge pull request #519 from Banane9/master
pardeike Apr 3, 2023
933620d
Merge pull request #521 from Banane9/add-delegate-overload-505
pardeike Apr 3, 2023
cd26a43
fixes matching of code[operand] (#513)
pardeike Apr 3, 2023
4ff5696
bumb to v2.3
pardeike Apr 3, 2023
e44127d
butchered but compiling, several tests failing
pardeike Apr 4, 2023
f878def
improvements
pardeike Apr 4, 2023
b6ed2a2
updates ref assemblies to 1.0.3
pardeike Apr 4, 2023
b5d616d
uses net452 instead of net45 (no sdk avail)
pardeike Apr 4, 2023
708ce68
fixes all failing tests
pardeike Apr 4, 2023
9d21152
updates net45 to net452
pardeike Apr 4, 2023
0a0af58
adds net7 to test sdk matrix
pardeike Apr 4, 2023
50d3251
reverts ILRepack.Lib.MSBuild to 2.1.14
pardeike Apr 4, 2023
60405da
fixes failing tests
pardeike Apr 4, 2023
45efa8d
adds prerelease info for nuget
pardeike Apr 4, 2023
78f220b
adds debug output for azure debugging
pardeike Apr 4, 2023
1ed1ae4
alpha.2
pardeike Apr 4, 2023
e29a0a9
disables ilrepack as a test
pardeike Apr 4, 2023
85aa7d7
disables method-from-stackframe tests
pardeike Apr 4, 2023
6259310
removes debug output
pardeike Apr 4, 2023
1b5ff0f
disables more tests
pardeike Apr 4, 2023
f43955b
alpha.4
pardeike Apr 5, 2023
31aa9b6
Added netstandard2.0 reference assemblies support
Aragas Apr 7, 2023
4d9ae80
Replaced /lib to /ref for netstandard
Aragas Apr 7, 2023
be81a54
Removed System.Reflection.Emit.Lightweight
Aragas Apr 7, 2023
f810941
Merge pull request #523 from BUTR/netstandard_refasm
pardeike Apr 8, 2023
daeaa94
v2.3-alpha.5
pardeike Apr 8, 2023
24e2742
updates to prerelease.1
pardeike May 23, 2023
0e8d1c1
cleanup before 2.3 release
pardeike May 23, 2023
c5a526d
small fixes
pardeike May 25, 2023
f6b5daf
Prerelease 2 of Harmony v2.3
pardeike Jun 1, 2023
dd34cfe
Merge pull request #522 from pardeike/feature/monomod-core
pardeike Jun 1, 2023
7ab508c
fixes a bug where Harmony calls TargetMethods() always twice
pardeike Jun 7, 2023
6f91ae8
prerelease-3
pardeike Jun 11, 2023
41e9431
Update documentation [skip ci]
pardeike-bot Jun 12, 2023
b9206db
cleans up conditional compiles; tries to fix #533; refactors CodeMatc…
pardeike Jun 17, 2023
12fe301
Update documentation [skip ci]
pardeike-bot Jun 17, 2023
9c2efa5
Using `PlatformTriple.Current.GetIdentifiable` for a user submitted M…
Aragas Jun 28, 2023
d7396ca
Update documentation [skip ci]
pardeike-bot Jun 28, 2023
7f6a9ba
for fun revert back to MonoMod Core 1.0.0-prerelease.2
pardeike Jun 28, 2023
50c6209
Merge branch 'master' of https://github.com/pardeike/Harmony
pardeike Jun 28, 2023
16516e2
And back to MMC 1.0.0
pardeike Jun 28, 2023
5f82776
test: always add RET at end
pardeike Jul 2, 2023
b43eef8
new approach
pardeike Jul 2, 2023
eb79965
fixes unix tests (and a few bugs)
pardeike Jul 2, 2023
bcc3a09
patches Assembly.GetExecutingAssembly
pardeike Jul 10, 2023
68822de
more defensive
pardeike Jul 10, 2023
b680f92
simplifies handling of GetExecutingAssembly
pardeike Jul 12, 2023
3fdeb57
removes Test_PatchExceptionWithCleanup1
pardeike Jul 12, 2023
0b64f4c
GetExecutingAssembly Tuning and Tests (#537)
Aragas Jul 12, 2023
f05a536
housekeeping
pardeike Jul 12, 2023
feec730
removes more warnings
pardeike Jul 12, 2023
cda2226
Improves http_client tests
pardeike Jul 13, 2023
c2586e7
adds useful linux test shortcut
pardeike Jul 13, 2023
7e4183e
fixes CodeMatch(()=>...)
pardeike Jul 22, 2023
f7004f8
Update documentation [skip ci]
pardeike-bot Jul 22, 2023
4c9a3d1
Add null/zero return clarifcations for TargetMethod/s (#544)
SineSwiper Aug 27, 2023
5c42611
Update documentation [skip ci]
pardeike-bot Aug 27, 2023
7306263
Fix typo: auxilary -> auxiliary (#548)
ZXfkSIE Sep 15, 2023
77d37be
Update documentation [skip ci]
pardeike-bot Sep 15, 2023
18ce5f7
Documentation Auxiliary Methods - Attribute spelling issue. Plus logi…
erdelf Dec 4, 2023
c6e42d8
Update documentation [skip ci]
pardeike-bot Dec 4, 2023
7b26fbb
updates MonoMod.Core to latest prerelease
pardeike Dec 15, 2023
dbb0a86
Fix typo in intro.md
jivanf Dec 25, 2023
8444af2
Merge pull request #560 from jivanf/fix-docs-typo
pardeike Dec 26, 2023
d916a30
adds InnerTypes() and extensions for AccessTool methods on type Type
pardeike Dec 27, 2023
319307c
Update documentation [skip ci]
pardeike-bot Dec 27, 2023
606ba09
code cleanup, net8.0, optional ret code for methods ending in throw
pardeike Dec 29, 2023
b324216
Merge branch 'master' of https://github.com/pardeike/Harmony
pardeike Dec 29, 2023
4319b50
Update documentation [skip ci]
pardeike-bot Dec 29, 2023
1350ab8
v2.3-prerelease.4
pardeike Dec 29, 2023
e63e183
fixes a regression with methods ending in throw + ret
pardeike Jan 11, 2024
1b16c96
uses adapted versions of System.Text.Json for .NET 5-8 (#562)
pardeike Jan 11, 2024
1960f57
Support GenericInstance types in inline method signatures
Zetrith Jan 14, 2024
7b5158a
adds better detection for methods that end in dead code
pardeike Jan 22, 2024
1fcb42d
fixes test logic
pardeike Jan 22, 2024
7b4e5ef
Update documentation [skip ci]
pardeike-bot Jan 22, 2024
03b6426
Merge pull request #565 from Zetrith/master
pardeike Feb 2, 2024
1081de9
Ignore mono checksum bc it can fail in Azure somehow
pardeike Feb 2, 2024
89d4d9b
WIP: Fat/Lite Packages (#538)
Aragas Feb 2, 2024
04ba15b
Revert "WIP: Fat/Lite Packages (#538)"
pardeike Feb 2, 2024
6a1059b
Feature/fat version (#569)
pardeike Feb 3, 2024
072699c
Update bug_report.md
pardeike Feb 3, 2024
21f5091
removes debug logging
pardeike Feb 4, 2024
fc0537d
internalizes all dependency types
pardeike Feb 7, 2024
ff82ff4
Release v2.3
pardeike Feb 7, 2024
962e808
optimises PatchCategory(...)
pardeike Feb 12, 2024
2dec400
Update documentation [skip ci]
pardeike-bot Feb 12, 2024
c65ad05
filters out System. inherited types
pardeike Feb 12, 2024
f1c4421
Update documentation [skip ci]
pardeike-bot Feb 12, 2024
90520b8
code cleanup
pardeike Feb 12, 2024
3422ff5
Update documentation [skip ci]
pardeike-bot Feb 12, 2024
3869952
more cleanup & speed up PatchCategory(...)
pardeike Feb 12, 2024
fd02327
Update documentation [skip ci]
pardeike-bot Feb 12, 2024
5ce8bd9
Implemented a GitHub Actions testing pipeline (#575)
Aragas Feb 13, 2024
3ebbae3
small fixes
pardeike Feb 13, 2024
025b002
adds github test action badge
pardeike Feb 13, 2024
a862748
Fixed Mono not being tested (#577)
Aragas Feb 13, 2024
71b9836
renames test action
pardeike Feb 13, 2024
2ed05fa
cancel ongoing testing
pardeike Feb 13, 2024
d46b17b
better cancelling
pardeike Feb 13, 2024
f3d3122
Tests: Retry for MacOS (#579)
Aragas Feb 14, 2024
32e3f7b
Better mono setup on Windows (#578)
Aragas Feb 14, 2024
ca21a76
adds shortcuts for some API functions, cleans code and applies C#12 s…
pardeike Feb 19, 2024
2457353
Merge branch 'master' of https://github.com/pardeike/Harmony
pardeike Feb 19, 2024
be98a56
Update documentation [skip ci]
pardeike-bot Feb 19, 2024
2c2de77
updates summary
pardeike Feb 19, 2024
9615407
Update documentation [skip ci]
pardeike-bot Feb 19, 2024
16f00a1
reverts some [] syntax so it compiles in all .net versions
pardeike Feb 19, 2024
5f87799
Update documentation [skip ci]
pardeike-bot Feb 19, 2024
125a6d7
one more revert of [] syntax
pardeike Feb 19, 2024
2a09e7a
Tests: Added partial Rosetta 2 support (#580)
Aragas Feb 19, 2024
b2eb250
implements __resultRef (#582)
kohanis Feb 23, 2024
3c257bb
Update documentation [skip ci]
pardeike-bot Feb 23, 2024
a5677aa
fixes dependencies for thin version
pardeike Feb 26, 2024
37df904
mentions MonoMod.Core instead of MonoMod.Common, adds ref to nike4613
pardeike Feb 26, 2024
3a3a91d
Added SourceLink support (#587)
Aragas Mar 2, 2024
1dd31a8
Fix prefix skipping for dead-end code (#584)
kohanis Mar 2, 2024
c419782
excludes System.Reflection.Emit.* types, adds debug symbols
pardeike Mar 2, 2024
14eebba
Added pdb generation (#588)
Aragas Mar 2, 2024
caed8ec
v2.3.1
pardeike Mar 3, 2024
03a8be1
Added pdb generation 2 (#589)
Aragas Mar 3, 2024
45304b9
adds download counter
pardeike Mar 3, 2024
11b4245
adds latest release download link to download badge
pardeike Mar 3, 2024
2ccdfe6
Merge branch 'master' of https://github.com/pardeike/Harmony
pardeike Mar 3, 2024
a43ef19
Release 2.3.1
pardeike Mar 3, 2024
e8b8cb7
Moved ref/netstandard2.0 into Lib.Harmony.Ref (#591)
Aragas Mar 3, 2024
792585c
Fixed the unnecessary lib folder in Ref package (#593)
Aragas Mar 3, 2024
aa94c99
fixed netstandard problem
pardeike Mar 3, 2024
39d924d
Fixed Ref Package (#594)
Aragas Mar 3, 2024
0126028
Release v2.3.1.1
pardeike Mar 3, 2024
e29e6ff
Update documentation [skip ci]
pardeike-bot Mar 3, 2024
76b4879
restores newlines
pardeike Mar 3, 2024
712d70d
Merge remote-tracking tag 'harmony/v2.3.1.1'
kohanis May 30, 2024
22b8398
MonoMod.RuntimeDetour version bump
kohanis Mar 14, 2024
627bb6d
Changing stack trace fixes to il replacements
kohanis Mar 15, 2024
e7fe272
Implementing stack trace fixes tests
kohanis Mar 15, 2024
dc5b5ee
Fixing ManagedMethodPatcher.DetourTo return
kohanis Mar 15, 2024
173f2f6
Native detour patcher restructuring
kohanis Mar 15, 2024
c248ad1
Reverse patch hotfix
kohanis Mar 15, 2024
0794ba0
Adjusting workflows
kohanis Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updates to prerelease.1
  • Loading branch information
pardeike committed May 23, 2023
commit 24e27428e8f9b6f749f65daac521f74e5a517784
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<HarmonyVersion>2.3.0.0</HarmonyVersion>
<MonoModCoreVersion>23.3.22.1</MonoModCoreVersion>
<HarmonyPrerelease>-prerelease.1</HarmonyPrerelease>
<MonoModCoreVersion>1.0.0-prerelease.1</MonoModCoreVersion>
</PropertyGroup>

</Project>
6 changes: 2 additions & 4 deletions Harmony/Documentation/Documentation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MonoModReorg.Core" Version="$(MonoModCoreVersion)" />

<!-- Reference assemblies are needed for non-Windows .NET Framework targeting builds. -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net35" Version="1.0.3">
Expand All @@ -35,8 +37,4 @@
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoMod.Common" Version="$(MonoModCommonVersion)" />
</ItemGroup>

</Project>
45 changes: 45 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Cecil.Cil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Code))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ConstantDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformationKind))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Document))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentHashAlgorithm))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguage))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguageVendor))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandler))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandlerType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.FlowControl))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ILProcessor))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugDirectory))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeader))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeaderEntry))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTarget))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTargetKind))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Instruction))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.InstructionOffset))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReader))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReaderProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriter))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriterProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodBody))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCode))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodeType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OperandType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ScopeDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SequencePoint))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StackBehaviour))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotFoundException))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotMatchingException))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDebugInformation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableReference))]
#endif
5 changes: 5 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbReader))]
#endif
6 changes: 6 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbReader))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbWriter))]
#endif
8 changes: 8 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.IILVisitor))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ILParser))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ModuleDefinitionRocks))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.TypeDefinitionRocks))]
#endif
85 changes: 85 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Cecil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyHashAlgorithm))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolutionException))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.CallSite))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttribute))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeArgument))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeNamedArgument))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ExportedType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameter))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterAttributes))]
#if NET472
[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterConstraint))]
#endif
[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IAssemblyResolver))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ICustomAttributeProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IGenericParameterProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMemberDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporter))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporterProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataResolver))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataScope))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataTokenProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMethodSignature))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.InterfaceImplementation))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporter))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporterProvider))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ManifestResourceAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MarshalInfo))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MemberReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataKind))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataScopeType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataToken))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodCallingConvention))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodImplAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReturnType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodSemanticsAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleCharacteristics))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleKind))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleParameters))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.NativeType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeInfo))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReaderParameters))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReadingMode))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResolutionException))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.Resource))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResourceType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAction))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAttribute))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityDeclaration))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetArchitecture))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetRuntime))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TokenType))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeAttributes))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeDefinition))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeReference))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeSystem))]
[assembly: TypeForwardedTo(typeof(Mono.Cecil.WriterParameters))]
#endif
5 changes: 5 additions & 0 deletions Harmony/ForwardingAttributes/Mono.Collections.Generic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.Collection<>))]
#endif
18 changes: 18 additions & 0 deletions Harmony/ForwardingAttributes/Mono.CompilerServices.SymbolWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.AnonymousScopeEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedScope))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedVariable))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CodeBlockEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CompileUnitEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberTable))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LocalVariableEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MethodEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFile))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.NamespaceEntry))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.OffsetTable))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ScopeVariable))]
[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceFileEntry))]
#endif
6 changes: 6 additions & 0 deletions Harmony/ForwardingAttributes/MonoMod.Utils.Cil.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Cil.CecilILGenerator))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Cil.ILGeneratorShim))]
#endif
11 changes: 11 additions & 0 deletions Harmony/ForwardingAttributes/MonoMod.Utils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#if NETFRAMEWORK || NETSTANDARD2_0
using System.Runtime.CompilerServices;

[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DMDEmitDynamicMethodGenerator))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DMDGenerator<>))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DynamicMethodDefinition))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Extensions))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.ICallSiteGenerator))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.ReflectionHelper))]
[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Relinker))]
#endif
71 changes: 2 additions & 69 deletions Harmony/Harmony.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<Version>$(HarmonyVersion)</Version>
<AssemblyVersion>$(HarmonyVersion)</AssemblyVersion>
<FileVersion>$(HarmonyVersion)</FileVersion>
<PackageVersion>$(HarmonyVersion)-alpha.5</PackageVersion>
<InformationalVersion>$(HarmonyVersion)-alpha.5</InformationalVersion>
<PackageVersion>$(HarmonyVersion)$(HarmonyPrerelease)</PackageVersion>
<InformationalVersion>$(HarmonyVersion)$(HarmonyPrerelease)</InformationalVersion>
</PropertyGroup>

<!-- In .NET 5.0 Binary Formatters are off by default. Support is added for .NET 5.0+ for fallback JSON Serialization -->
Expand Down Expand Up @@ -64,36 +64,6 @@
</Otherwise>
</Choose>

<!-- ILRepack config needs to be specified before MonoMod.Common PackageReference due its dependency on properties defined here.
<Choose>
<When Condition="!$(IsCoreOrStandard) And '$(Configuration)'=='Release'">
<PropertyGroup>
<ILRepackInternalize>true</ILRepackInternalize>
</PropertyGroup>
<Choose>
<When Condition="$([System.Environment]::GetEnvironmentVariable('DYLD_FALLBACK_LIBRARY_PATH'))=='' And $([MSBuild]::IsOsPlatform('OSX'))">
<PropertyGroup>
<DoILRepack>false</DoILRepack>
<DoExecILRepack>true</DoExecILRepack>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DoILRepack>true</DoILRepack>
<DoExecILRepack>false</DoExecILRepack>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
<Otherwise>
<PropertyGroup>
<ILRepackInternalize>false</ILRepackInternalize>
<DoILRepack>false</DoILRepack>
<DoExecILRepack>false</DoExecILRepack>
</PropertyGroup>
</Otherwise>
</Choose> -->

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="..\LICENSE" Pack="true" PackagePath="" />
Expand All @@ -118,23 +88,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net35" Version="1.0.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="MonoModReorg.Core" Version="$(MonoModCoreVersion)">
<!-- <PrivateAssets Condition="$(ILRepackInternalize)">all</PrivateAssets> -->
</PackageReference>

<!-- Reference assemblies are needed for non-Windows .NET Framework targeting builds. -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />

<!--
See ILRepack config above.
Version 2.1.15+ currently doesn't work on Linux and macOS (results in "Current platform not supported. Unable to find .NET Framework root"),
WE MUST USE VERSION 2.1.14 HERE FOR NOW!

<PackageReference Include="ILRepack.Lib.MSBuild" Version="2.1.14" PrivateAssets="all" /> -->
</ItemGroup>

<!-- netstandard2.0 reference assemblies -->
Expand Down Expand Up @@ -171,32 +130,6 @@
<Compile Remove="**\*.net7.cs" />
</ItemGroup>

<!--
On macOS .NET Framework builds, ILRepack uses Mono.Posix package for copying file permissions, but this problematic because:
1) Its P/Invoke usage relies on dynamic linking with the native libs (specifically, libMonoPosixHelper.dylib) of the Mono install(s),
(which are typically rooted at /Library/Frameworks/Mono.framework).
2) Mono.Posix.dll's dynamic linking doesn't specify absolute paths, so it relies on DYLD_* environment variables for searching for the dylib.
3) However, these DYLD_* environment variables are often unset in modern macOS due to SIP:
https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
This results in "Unable to load shared library 'MonoPosixHelper' ... at Mono.Unix.Native.Syscall.stat..." errors.

Workaround:
We default DYLD_FALLBACK_LIBRARY_PATH to what's supposed to be its default value, prepended by Mono's lib folder.
However, dyld already initializes and reads DYLD_* env vars before any target is run (even before InitialTargets targets),
so we must spawn a new process via the Exec task that sets DYLD_* env vars and runs msbuild on the ILRepack target.
Furthermore, DYLD_* env vars aren't inherited (even if specified via Exec's EnvironmentVariables attribute), probably due to SIP,
so we must set DYLD_* env vars within the Exec'd command itself.

<Target Name="ExecILRepack" AfterTargets="PostBuildEvent" Condition="$(DoExecILRepack)">
<PropertyGroup>
<DYLD_FALLBACK_LIBRARY_PATH>/Library/Frameworks/Mono.framework/Versions/Current/lib:$(HOME)/lib:/usr/local/lib:/lib:/usr/lib</DYLD_FALLBACK_LIBRARY_PATH>
<MSBuildCmd Condition="'$(MSBuildRuntimeType)'!='Core'">"$(MSBuildToolsPath)\MSBuild.exe"</MSBuildCmd>
<MSBuildCmd Condition="'$(MSBuildRuntimeType)'=='Core'">"$(DOTNET_HOST_PATH)" msbuild</MSBuildCmd>
<MSBuildCmdArgs>"-p:TargetFramework=$(TargetFramework);Configuration=$(Configuration);DoILRepack=true" -t:ILRepack</MSBuildCmdArgs>
</PropertyGroup>
<Exec Command="export DYLD_FALLBACK_LIBRARY_PATH=$(DYLD_FALLBACK_LIBRARY_PATH); $(MSBuildCmd) $(MSBuildCmdArgs)" />
</Target> -->

<Target Name="RemoveOldNuGetPackages" BeforeTargets="PreBuildEvent">
<PropertyGroup>
<WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)</WorkingDirectory>
Expand Down
2 changes: 1 addition & 1 deletion Harmony/Public/InlineSignature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace HarmonyLib
/// Used by the calli instruction, can be used by transpilers
/// </summary>
///
public class InlineSignature : ICallSiteGenerator
internal class InlineSignature : ICallSiteGenerator
{
/// <summary>See <see cref="System.Reflection.CallingConventions.HasThis"/></summary>
///
Expand Down
6 changes: 2 additions & 4 deletions HarmonyTests/HarmonyTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoModReorg.Core" Version="$(MonoModCoreVersion)" />

<!-- Reference assemblies are needed for non-Windows .NET Framework targeting builds. -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MonoModReorg.Core" Version="$(MonoModCoreVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp'">
<PackageReference Include="Lokad.ILPack" Version="0.1.4" PrivateAssets="all" />
</ItemGroup>
Expand Down