|[Back to weblog: pretention]|
Logically, it seems like someone should just make NUnitAsp use Rhino, like HttpUnit. The small problem is that Rhino is itself written in Java. So, how do we access that java library from C#? There are a couple of ways: 1) Convert Rhino's Java source code to C#, thereby making a "fork"; 2) Use IKVM (http://www.ikvm.net/) to run the compiled Java code 'natively' and access the code from C#; 3) Compile the Rhino code in Visual J#, leaving the code (relatively) as-is and resulting in a pure managed assembly from NUnitAsp to reference.
I chose to try out option #3 first since it won't fork the code, require another component (IKVM), and would be relatively simple to try out. I tried it out in Visual J# 2005 (http://msdn.microsoft.com/vjsharp/). First, I had to manually create a new J# project and add the *.java files from Rhino 1.5R5. I chose that version of Rhino because it doesn't have external library dependencies, and it looks like 1.6R* does. Once all the files were in, I compiled. Most of the compiler errors were uninitialized variable false positives which I fixed by explicitly initializing some variables.
THAT WAS IT, FOLX.
I now have Rhino compiled to a native .NET assembly. Now I just need to figure out how to integrate NUnitAsp with it, but I'm sure I'll need an NUnitAsp developer's help with that. It was really cool that my hunch played out -- guess some good came out of waking up at 3am and being unable to get back to sleep :)
I also don't know about the dependencies on the J# libraries -- that may impair this working OOTB on mono. Those are secondary goals, of course :) Any takers for getting NUnitAsp to use some of Rhino .NET's capabilities?
Discussion:showing all 0 messages
|(last modified 2006-02-13) [Login]|