| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far we only matched a substring of a type, which isn't very exact of
course. We also weren't able to specify the method to patch.
Now the methods that are being patched can be specified by using
Type::Method. If it's just Type without a method all the methods of the
type and its subtypes are patched.
I also added a small check to make sure that all of these methods were
found, and if not an error is thrown.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
| |
If there is a command line usage error, we really don't want the program
to return exit status 0 (success), so let's actually set the return
value on WithParsed().
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
| |
If we want to replace a call with one that's not in a module which is
currently referenced by the target file we now have another command line
flag for replace-call (-a) where we can specify the additional DLL file.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default the assemblies are searched in the current working directory,
but when patching an assembly in some other directory than the current
the patcher will fail to resolve assemblies residing beneath the target
file.
So we just add the directory of the target file to the search path.
I also moved all of the assemblies in the test to be in a subdir so we
can verify that this indeed works and we won't regress in the future.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the command is not executed inside a terminal the value of
Console.WindowWidth is 0 and thus we will get an exception from
CommandLineParser:
Unhandled Exception:
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring ...
at CommandLine.Text.HelpText.AddOption ...
...
So let's initialize the parser with settings and if WindowWidth is 0 we
just add 80 as the width.
Signed-off-by: aszlig <aszlig@nix.build>
|
|
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>
|