Titanium Mobile custom runtime build

We have a custom branch of the Titanium Mobile runtime library for our StatusNet client.

What's included:
 * custom module to optimize Atom feed parsing on Android
 * custom module (pending integration upstream) for XML serialization -- currently required
 * Bug fixes for some items from Client/Titanium issues
 * fix for iPhone 4 resolution detection
 * fix for several XML bugs on iPhone
 * and more!

Want to skip the build?
I have pre-built binaries of the current custom fix branch for Mac OS X and Linux x86_64 (Ubuntu 10.04, untested elsewhere) as of our beta6 release:
 * http://statusnetdev.net/mobile/beta6/mobilesdk-1.4.1-linux.zip (Android only)
 * http://statusnetdev.net/mobile/beta6/mobilesdk-1.4.1-osx.zip (Android & iPhone support)

Now skip down to !

Requirements

 * Android SDK and all that entails
 * If wanting to build iPhone libs, a Mac w/ current iPhone SDK (3.2/4)
 * git
 * scons

Get source
git clone git://github.com/appcelerator/titanium_mobile.git cd titanium_mobile git remote add brion git://github.com/brion/titanium_mobile.git git fetch brion git checkout -b myfixes brion/myfixes

Build
To build...

scons android_sdk=~/android-sdk

(or whatever the appropriate path to your android SDK is!)

On Linux if you get an error message that the Java compiler can't be found but you're sure you've got a full JDK set up, you may need to override your $JAVA_HOME. I've definitely had this problem on Ubuntu 10.04 with OpenJDK; the error message contains a path with '/jre' at the end -- pull the 'jre' off and put the rest in like this:

JAVA_HOME=/usr/lib/jvm/java-6-openjdk scons android_sdk=~/android-sdk

This'll make a .zip file in the dist/ subdirectory with the version number and your operating system, something like this:

mobilesdk-1.4.1-linux.zip mobilesdk-1.4.1-osx.zip

Install
You'll want to unzip that file into the Titanium settings directory, where there's already a 'mobilesdk' folder with the regular distributed SDKs. This could be several places:


 * Linux
 * ~/.titanium or install dir like /opt/titanium?


 * Mac
 * /Library/Application Support/Titanium


 * Windows
 * .... excellent question. :D

Don't remove the existing subfolders in there! If you need to, unzip in another directory, then just copy in the '1.4.1' or whatever folder.

I like to use a little shell script to do this in one step:

scons android_sdk=/Users/brion/android-sdk && \ (cd '/Library/Application Support/Titanium' && \  unzip -o ~/src/titanium/titanium_mobile/dist/mobilesdk-1.4.1-osx.zip)

Note that the 1.4.1 version number will change at some point, so make sure it's current before you go unzipping things.