I’ve been keeping an eye on JavaFXports ever since Johan announced the project. From time to time I test the latest builds to see how the project grows. A few months ago we had a breakthrough with Griffon and the jfxmobile plugin; after a few tweaks (and some API changes from Griffon’s side) it was clear that running Griffon on an iOS device was no longer a wild dream, but rather a reality.
So what about those API changes? There were actually not that widespread, actually they were concentrated to a particular set of common, standard APIs that every Java SE developer knows and encounters almost ever single day: the java.beans package. For historical and practical reasons RoboVM relies on the Android SDK to enable Java (and JavaFX) to run on Android and iOS devices. This brings along some of the restrictions Android users know by heart: black listed classes such as the ones contained in the aforementioned package. The only way to make things work was to replace the black listed API with something that’s functionally equivalent but with a different name, and so openbeans got into the picture. Funny thing, this package contains code from Apache Harmony, the alternate “Java” implementation that never was.
Anyway, it was clear that a breakage in compatibility was needed in order to allow Griffon applications to reach out into the mobile space with JavaFXports’ help. We’re over a year now since Griffon 2.0.0 was released; the 2.x line broke compatibility with the previous series, and the team thinks we still have a few more releases before we decide to break compatibility again for 3.0.0, if needed be. But we don’t want to wait long in order to enjoy the benefits of Griffon on mobile, so we came up with a different plan: fork Griffon.
Basilisk is a fork of the Griffon 2 codebase (2.5.0-SNAPSHOT as we speak) that aims to bring the Griffon experience to mobile/desktop application development. Basilisk targets Java8 and JavaFX8 specifically, any Java developer will be able to pick it up quite easily.
For now, the differences between Griffon and Basilisk are minimal, besides the package renaming and the usage of openbeans almost everything else is the same. Migrating between one framework to the other can be done with a small set of steps:
We expect Basilisk to grow on its own, sporting features that make sense for desktop and mobile environments. It will be possible to migrate features between Griffon and Basilisk, so that porting applications will remain an easy task. While Griffon remains as the preferred solution for building all kind of desktop applications, from the very small to the full fledged, enterprise ready ones, we foresee Basilisk taking its place as the choice for developers that need to build applications that cross between desktop and mobile spaces.
There’s no release yet for Basilisk; there are still some migration aspects to be taken care of, such as the guide and documentation, however you can take Basilisk for a spin right now by simply cloning https://github.com/basilisk-fw/basilisk.git and building your own version. It’s as simple as
$ curl -s http://get.sdkman.io | bash
$ sdkman install gradle
$ git clone https://github.com/basilisk-fw/basilisk.git
$ cd basilisk
$ gradle publishToMavenLocal
$ gradle installAllTemplates
After this you can use the provided templates to create and test an application
$ sdkman install lazybones
$ lazybones create basilisk-javafx-ios 0.1.0-SNAPSHOT sample
$ cd sample
$ gradle launchIPhoneSimulator
Don’t be fooled by the low version number, Basilisk comes from a fine codebase lineage that includes Griffon (2008) and Grails (2005), it’s pretty mature as you will see.
These are exciting times to be building Java(FX) applications for desktop and mobile.
Keep on Groovying!