summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/Rewriters
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-07-11 01:44:02 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-07-11 01:44:02 -0400
commitbd20c2e1375ed5e32315ef5e292802bccc42f530 (patch)
tree32f30b832d9bf41af3391c75463247ac262e89b7 /src/SMAPI/Framework/ModLoading/Rewriters
parent8f96a97f070d654764de3b138678d8f62707f485 (diff)
downloadSMAPI-bd20c2e1375ed5e32315ef5e292802bccc42f530.tar.gz
SMAPI-bd20c2e1375ed5e32315ef5e292802bccc42f530.tar.bz2
SMAPI-bd20c2e1375ed5e32315ef5e292802bccc42f530.zip
alias Mono.Cecil references (#711)
This is needed to migrate to Harmony 2.0 because it uses MonoMod, which has a copy of Mono.Cecil merged into its assembly, which leads to "type X exists in both 0Harmony.dll and Mono.Cecil.dll" errors. We can't use the version bundled with MonoMod since only some of the types are publicly accessible.
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/Rewriters')
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/FieldReplaceRewriter.cs6
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs6
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs6
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/HeuristicMethodRewriter.cs6
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs6
-rw-r--r--src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs4
6 files changed, 23 insertions, 11 deletions
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/FieldReplaceRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/FieldReplaceRewriter.cs
index 0b679e9d..d40d4111 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/FieldReplaceRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/FieldReplaceRewriter.cs
@@ -1,7 +1,9 @@
+extern alias MonoCecilPackage;
+
using System;
using System.Reflection;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
+using MonoCecilPackage.Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil.Cil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs
index 4b3675bc..147a12f9 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/Harmony1AssemblyRewriter.cs
@@ -1,8 +1,10 @@
#if HARMONY_2
+extern alias MonoCecilPackage;
+
using System;
using HarmonyLib;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
+using MonoCecilPackage.Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil.Cil;
using StardewModdingAPI.Framework.ModLoading.Framework;
using StardewModdingAPI.Framework.ModLoading.RewriteFacades;
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
index f59a6ab1..c381e4e5 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicFieldRewriter.cs
@@ -1,7 +1,9 @@
+extern alias MonoCecilPackage;
+
using System.Collections.Generic;
using System.Linq;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
+using MonoCecilPackage.Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil.Cil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicMethodRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicMethodRewriter.cs
index e133b6fa..748c1e6f 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicMethodRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/HeuristicMethodRewriter.cs
@@ -1,7 +1,9 @@
+extern alias MonoCecilPackage;
+
using System.Collections.Generic;
using System.Linq;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
+using MonoCecilPackage.Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil.Cil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs
index 9933e2ca..5e0d9c70 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/MethodParentRewriter.cs
@@ -1,7 +1,9 @@
+extern alias MonoCecilPackage;
+
using System;
using System.Linq;
-using Mono.Cecil;
-using Mono.Cecil.Cil;
+using MonoCecilPackage.Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil.Cil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters
diff --git a/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs b/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs
index ad5cb96f..a4d09ae9 100644
--- a/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs
+++ b/src/SMAPI/Framework/ModLoading/Rewriters/TypeReferenceRewriter.cs
@@ -1,5 +1,7 @@
+extern alias MonoCecilPackage;
+
using System;
-using Mono.Cecil;
+using MonoCecilPackage.Mono.Cecil;
using StardewModdingAPI.Framework.ModLoading.Framework;
namespace StardewModdingAPI.Framework.ModLoading.Rewriters