Hecl news – conditional compilation, tools

For the curious, who read Conditional Compilation in Java, and were waiting on the edge of their seats to know what happened, we decided to use Antenna, with the work being done mostly by Wolfgang. It’s not particularly elegant – the source code ends up being, in some places, what the Italians call a “pugno nell’occhio” – a “fist in the eye”. But all things considered, it’s not that bad, and it’s better than writing the same file in slightly different ways in different subdirectories, especially in those cases where the code changes only slightly from one version to another. As a bonus, Antenna gives you a lot of handy tasks for doing common j2me things.

Indeed, Wolfgang did a very nice job of revamping the Hecl build system, and after a bit of additional tweaking, it works very well. It builds different .jars and .jads for different targets, so that it’s easy to develop for new platforms without stepping on everyone else’s toes.

My current plans are to spend some more time on build tools and infrastructure – I think more people will start to experiment with Hecl once they realize just how easy it is to build applications. You don’t even need a java compiler if you use HeclBuilder, which is a simple GUI that lets you specify the input script, the jar file to create, and then generates a new Hecl application read to be loaded onto a cell phone. It does this by keeping a copy of Hecl.jar as a resource, which it then modifies (replacing the script.hcl resource that the Hecl.jar itself contains) and then writes out as a new .jar/.jad. The long and short of it being that you have a very quick edit/”build”/test cycle when using an emulator. I have some ideas about improving on this even more, perhaps utilizing microemulator, which, although not as complete as Sun’s WTK emulator, is open source and thus redistributable with Hecl.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s