Groovy running fine on .NET

[转载]Groovy running fine on .NET

Groovy running fine on .NET

It's just a crazy idea to test Groovy on .NET, after I read this post on IKVM weblog that the author test IKVM using JRuby. If JRuby runs fine, probably Groovy does so.

Simple steps here,

1. Download .NET 2.0 Runtime.
2. Download SharpDevelop IDE 2.1, just in case that you're lazy enough to code.
3. Download IKVM for .NET 0.34 rc2 binary
4. compile your Groovy jar with the following command:

ikvmc -target:library groovy-all-1.1-SNAPSHOT.jar

Some errors will appear, just ignore them.
You'll get groovy-all-1.1-SNAPSHOT.dll.

5. Open SharpDevelop, create a new .NET console application.
6. Add references, all IKVM DLLs and your groovy DLL.
7. Open your main class, type the following code (in C# for example)
using System;
using System.Collections.Generic;

namespace GroovyDotNet {
class MainClass {
public static void Main(string[] args) {
groovy.ui.InteractiveShell.main(args);
}
}
}

8. Run the program, and you'll also have an executable file as well.

Alright, if you don't want to get your hand dirty, do step 1 and wait for the binary. I'll upload it soon.



and here's the binary.

原文地址:http://chanwit.blogspot.com/2007/04/groovy-running-fine-on-net.html
附: FAQ —— Groovy & Grails

你可能感兴趣的:(Groovy running fine on .NET)