TantalumMobile/Tantalum — pull request #13 by kaiinkinen (2013-03-14 01:53:11+00:00)
Title: Support building Tantalum through Gradle (1.4)

Having only an 'IDE-enabled' build, we're restricting the number of potential people who might be interested in using the library. By providing a structured almost-out-of-the-box build system, people are able to build the library with all the examples and unit tests to verify that the build is sane. Using e.g. gradle is also almost mandatory for setting up some form of CI system for the library, as one cannot depend on an interactive build in the automated process. Gradle has quite nice support in the various IDEs (Netbeans, IDEA, eclipse?), so it should also allow for easier setup of the dev environment.

In order for the build to run, one needs to:
* Install the WTK toolkit from Oracle
* Define the env variable JAVA_ME_HOME to point to the wtk home
* Install standard Java SDK, either 1.6 or 1.7
* Install Gradle. I've tested it with Gradle-1.4, add the path to it
* Trigger the build through 'gradle build'

I've tested the vanilla setup to work on on OS X (Mountain Lion, Java 1.6, WTK 3.0) and Windows 8 (JDK 1.7.0_17, WTK 3.2), so running it from Linux, given that WTK is available, should be feasible. The only caveat is that the user needs to create a symlink on OS X for this to work ('ln -s /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/{classes,rt}.jar'). I've documented this case in the build files. The default setup works as it is on Windows, since I'm assuming this is where the most of the audience is, anyway.

Other changes in the pull request:
- There's a J2SE-test project, which is used to run unit tests against the library. The number of tests is still quite small, but using J2SE for testing we have a much wider array of tools at our disposal. E.g. unit test coverage is currently already enabled on the build.

- Various quality tools and metrics have been enabled for the build. Currently the library code is analyzed with pmd, findbugs and jdepend. The thresholds for the metrics have been turned off, so builds will not fail, but it might make sense to configure some minimum standards, if accepting changes from externals.

- Not all of the example projects are being built at the moment, as they would introduce dependencies to LWUIT and the Nokia S40 SDK. Having those be a default part of the library code is probably a bit too heavy-weight.

Some glitches still need to be fixed
1) Static tests run twice. Once for the original sources, once for the preprocessed release sources.
2) IDE-setup is not fully automatic
3) General build-file cleanup. Now there are a few custom things in them, which should be standardised if possible

Please review and merge, if you find this acceptable. Any feedback would be welcome.
.kai