Today I added this little piece of code to the trunk of xUnit.BDDExtensions. It’s a rake task for merging assemblies via the ILMerge tool.
1 2 3 4 5 6 7 8 | |
Ruby is a fantastic language. The more I learn about it the more I actually like it. Let’s have a look at how this task is implemented. First of all I opened up Ruby’s string class and added new methods to it (this is called MonkeyPatching, and worth a blog post on its own :-))
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
And here is the actual ilmerge - method. It simply gets the complete path to the ILMerge.exe (not shown here), expands the name to all
assemblies that have to be merged and escapes them, before the actual call to ILMerge is issued over the console …
1 2 3 4 5 6 | |
Currently 3 assemblies pop out of the Rake build. These are xunit.dll, xunit.bddextensions.dll and Rhino.Mocks.dll. While it’s technically no
problem to merge them into a single assembly (and of course I would love to have it that way) there are two problems currently not solved. The
R# runner dynamically loads the xunit.dll to run the tests and StructureMap.AutoMocking.dll dynamically loads Rhino.Mocks.dll. That’s
the reason why I’m currently not able to merge it.
Any suggestions how to solve that?