Pages

Sunday, November 2, 2014

Initial experience with Xtend + RoboVM

Setting stuff up


I woke up feeling like doing something for Xtend developers, so I decided to check out RoboVM.

RoboVM is a project sponsored by Trillian Mobile AB, Gothenborg, Sweden.


I had so much fun contributing to the Xtendroid, I thought I could pull the same trick for the RoboVM project; the trick being writing massively intelligent boilerplate killers for common coding tasks.

I plan to use Xtend and its active annotations to cut away RoboVM boilerplate.

I set up the following things:
  • Installed java 8; (\o/ yea for lambdas)
  • Installed Xcode, installed the command-line tools (you must have a mac);
  • Installed Eclipse (version Luna, updated it);
  • Installed Xtend on eclipse via the update site;
  • Installed RoboVM on eclipse via the update site;
  • Cloned (via git) and imported (eclipse) the official RoboVM sample projects;
  • Cloned an imported the Xtend+RoboVM sample project
Also checkout these RoboVM bindings, they might be useful later.

Caveat emptor!

Beware buyer! I immediately got the feeling that the samples aren't being maintained much after the recent release; some of the method names declared in the official RoboVM samples are slightly fubar. Eclipse will complain that certain @Override declarations are not required. You will have to find the correct method and rename the borken method to that correct one. Most of the work requires matching method signatures.

If you feel generous, you can do a pull-request via github where the samples are hosted; that's what I'm planning on doing too.

The other thing that bothered me is the following error that occurs after you push the compile button, on certain sample projects:

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/ref/FinalReference

After I filtered through the noise on StackOverflow and some additional mucking around with java and eclipse.ini, it dawned on me, that I should use "compile as..." build option instead of trusting the default compilation settings.

Everything went smoothly afterwards.

Watch this space

Like I said, I plan on doing a Xtendroid on RoboVM. I think I'll call it XtendRobo, because it sounds cute.

Cheerio.