ruboto/ruboto — pull request #642 by tek (2014-07-11 14:22:22+00:00)
Title: generate java methods in the build process only for implemented ruby met...

This is a proof of concept implementation for an alternative way of generating the java method proxies that relay the calls to the ruby implementation.

This method stores the Android API metadata for Activity et al as a ruby hash in asset files inside the project dir.
When building the project, a rake task obtains all implemented method names from the ruby source (as previously) and then writes proxy methods into an intermediate superclass of the Activity, in which the method is called directly, avoiding the need to test different spelling variants. (I would propose to actually require the source file and read the methods from the class object, in order to allow inheritance and modules for the ruby class, but I don't know whether this can be done reliably.)
The code is generated via erb templates, because ruboto's templating engine is a little confusing to read and this is the canonical and clean way to generate code in my opinion.

This commit handles only a small part of the classes and edge cases and there are several workarounds where a sensible implementation should be created by a maintainer, so this PR is only an RFC, not intended to be merged. Please tell me what you think of it!