org.codehaus.mojo.javascript.titanium
Class TitaniumUtils

java.lang.Object
  extended by org.codehaus.mojo.javascript.titanium.TitaniumUtils

public class TitaniumUtils
extends java.lang.Object

Titanium utility class. Contains helper methods related to Titanium.


Field Summary
static java.lang.String ENV_ANDROID_HOME
          The android home environment variable name.
 
Constructor Summary
TitaniumUtils()
           
 
Method Summary
static void checkVirtualDevice(java.lang.String platform, TitaniumSettings settings, VirtualDevice virtualDevice)
           
static boolean createAvd(java.io.File androidSdkHome, java.lang.String avdId, java.lang.String skin, org.apache.maven.plugin.logging.Log log)
          Create a new Android AVD.
static java.lang.String getAndroidHome()
          Retrieve the Android SDK home folder based on the ANDROID_HOME environment variable.
static java.util.List<java.lang.Integer> getAvailableAndroidPlatformVersions(java.io.File androidSdkHome)
          Retrieve the list of the available platforms for the specified Android SDK folder.
static java.lang.String getLatestAndroidPlatformVersion(java.io.File androidSdkHome)
          Retrieve the latest android API version of the specified android SDK
static java.lang.String getLatestIosPlatformVersion()
           
static java.lang.String getOsClassifier()
           
static java.lang.String getTitaniumArtifactSdkPath(java.lang.String version, java.io.File targetDir)
           
static java.lang.String getTitaniumSdkPath(java.lang.String version)
           
static boolean isAndroidEmulatorRunning(java.io.File androidSdkHome)
           
static boolean isAndroidVersionValid(java.io.File androidSdkHome, java.lang.String version)
           
static boolean isIphoneVersionValid(java.lang.String version)
           
static java.util.List<java.lang.String> listAvailableIosPlatformVersions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENV_ANDROID_HOME

public static final java.lang.String ENV_ANDROID_HOME
The android home environment variable name.

See Also:
Constant Field Values
Constructor Detail

TitaniumUtils

public TitaniumUtils()
Method Detail

getAndroidHome

public static java.lang.String getAndroidHome()
                                       throws org.apache.maven.plugin.MojoExecutionException
Retrieve the Android SDK home folder based on the ANDROID_HOME environment variable.

Returns:
The android SDK home folder.
Throws:
org.apache.maven.plugin.MojoExecutionException - When the android environment is not specified.

getAvailableAndroidPlatformVersions

public static java.util.List<java.lang.Integer> getAvailableAndroidPlatformVersions(java.io.File androidSdkHome)
                                                                             throws org.apache.maven.plugin.MojoExecutionException
Retrieve the list of the available platforms for the specified Android SDK folder.

Parameters:
androidSdkHome - The Android SDK home folder.
Returns:
A list of android API version.
Throws:
org.apache.maven.plugin.MojoExecutionException - When the android SDK folder doesn't exist.

getLatestAndroidPlatformVersion

public static java.lang.String getLatestAndroidPlatformVersion(java.io.File androidSdkHome)
                                                        throws org.apache.maven.plugin.MojoExecutionException
Retrieve the latest android API version of the specified android SDK

Parameters:
androidSdkHome - The android SDK home folder.
Returns:
The latest android API version
Throws:
org.apache.maven.plugin.MojoExecutionException - When The androidSdkHome is not valid.

isAndroidEmulatorRunning

public static boolean isAndroidEmulatorRunning(java.io.File androidSdkHome)
                                        throws java.io.IOException
Throws:
java.io.IOException

createAvd

public static boolean createAvd(java.io.File androidSdkHome,
                                java.lang.String avdId,
                                java.lang.String skin,
                                org.apache.maven.plugin.logging.Log log)
                         throws org.apache.maven.plugin.MojoExecutionException
Create a new Android AVD.

Parameters:
androidSdkHome - The android SDK home folder.
avdId - The android API version.
skin - The skin of the emulator.
log - The logging system.
Returns:
true if the avd was successfully created, false if the avd already existed.
Throws:
org.apache.maven.plugin.MojoExecutionException - When an error occured during the AVD creation.

getOsClassifier

public static java.lang.String getOsClassifier()

getTitaniumSdkPath

public static java.lang.String getTitaniumSdkPath(java.lang.String version)

getTitaniumArtifactSdkPath

public static java.lang.String getTitaniumArtifactSdkPath(java.lang.String version,
                                                          java.io.File targetDir)

isAndroidVersionValid

public static boolean isAndroidVersionValid(java.io.File androidSdkHome,
                                            java.lang.String version)
                                     throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

checkVirtualDevice

public static void checkVirtualDevice(java.lang.String platform,
                                      TitaniumSettings settings,
                                      VirtualDevice virtualDevice)
                               throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

isIphoneVersionValid

public static boolean isIphoneVersionValid(java.lang.String version)

listAvailableIosPlatformVersions

public static java.util.List<java.lang.String> listAvailableIosPlatformVersions()

getLatestIosPlatformVersion

public static java.lang.String getLatestIosPlatformVersion()


Copyright © 2011 SOFTEC sa. All Rights Reserved.