about summary refs log tree commit diff
path: root/pkgs/games/build-support/monogame-patcher/src/patcher.csproj
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-07-17 06:13:35 +0200
committeraszlig <aszlig@nix.build>2018-07-19 06:35:15 +0200
commit19408db5a4eaa309d3f84f6a2d056c5b8b7c8fcb (patch)
treee660ddbc789361e0a650b2a44893083b9bbfe20e /pkgs/games/build-support/monogame-patcher/src/patcher.csproj
parent2d3dabe8af2ea4abc51f68891741db360ad11c75 (diff)
monogame-patcher: Refactor method ref finding
So far we have searched for methods in two steps: First get all the
types and then find all of the constructors or method definitions.

The match for the actual method definition was done first for the type
and then again for the full definition of the method/constructor.

For the replace-call subcommand this also means that we don't have a
very good way to find the type, because if we wanted to keep doing this
in two steps we would need to parse the type name out of the one given
as the replacement string in replace-call.

So now we recurse through *all* the constructors and methods and do a
full match against the specified replacement string, both for
replace-call and for fix-filestreams.

Compared to the implementation so far we also do this just once instead
of every time we find a call or FileStream constructor.

I also overhauled the way we do testing, because in the end writing
tests using NUnit would introduce a lot of code churn because we need to
make a lot of external calls. The shell is especially useful for exactly
that and our tests are now just a plain shell script.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/build-support/monogame-patcher/src/patcher.csproj')
-rw-r--r--pkgs/games/build-support/monogame-patcher/src/patcher.csproj8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgs/games/build-support/monogame-patcher/src/patcher.csproj b/pkgs/games/build-support/monogame-patcher/src/patcher.csproj
index 994b78e5..03307287 100644
--- a/pkgs/games/build-support/monogame-patcher/src/patcher.csproj
+++ b/pkgs/games/build-support/monogame-patcher/src/patcher.csproj
@@ -7,7 +7,6 @@
     <Compile Include="assembly-info.cs"/>
     <Compile Include="options.cs"/>
     <Compile Include="patcher.cs"/>
-    <Compile Include="tests.cs"/>
   </ItemGroup>
 
   <PropertyGroup>
@@ -16,7 +15,6 @@
 
     <CecilInfo>Version=0.10.0.0$(Blurb)50cebf1cceb9d05e</CecilInfo>
     <CmdLineInfo>Version=2.2.1.0$(Blurb)de6f01bd326f8c32</CmdLineInfo>
-    <NUnitInfo>Version=3.10.1.0$(Blurb)2638cd05610744eb</NUnitInfo>
   </PropertyGroup>
 
   <ItemGroup>
@@ -24,12 +22,14 @@
       <SpecificVersion>False</SpecificVersion>
       <Private>True</Private>
     </Reference>
-    <Reference Include="Mono.Cecil.Rocks"/>
+    <Reference Include="Mono.Cecil.Rocks, $(CecilInfo)">
+      <SpecificVersion>False</SpecificVersion>
+      <Private>True</Private>
+    </Reference>
     <Reference Include="CommandLine, $(CmdLineInfo)">
       <SpecificVersion>False</SpecificVersion>
       <Private>True</Private>
     </Reference>
-    <Reference Include="nunit.framework, $(NUnitInfo)"/>
   </ItemGroup>
 
   <PropertyGroup>