Jenkins build script, kanged mainly from android-legacy (erikcas)