org.codehaus.mojo.javascript
Class AbstractTitaniumPackageMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.javascript.AbstractTitaniumPackageMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
TitaniumJasmineMojo, TitaniumPackageMojo

public abstract class AbstractTitaniumPackageMojo
extends org.apache.maven.plugin.AbstractMojo

Titanium package abstract base class;


Field Summary
protected  java.lang.String androidAPI
          The version of the platform for which the code should be compiled.
protected  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
           
protected  org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
           
protected  java.lang.String executeMode
          The package execution mode.
protected  java.lang.String iosDevelopmentCertificate
          The ios Development certificate.
protected  java.lang.String iosDevelopmentProvisioningProfile
          The iOS development provisioning profile.
protected  java.lang.String iosDistributionCertificate
          The ios Distribution certificate.
protected  java.lang.String iosDistributionProvisioningProfile
          The ios distribution provisioning profile.
protected  java.lang.String iosVersion
          The version of the platform for which the code should be compiled.
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
           
protected  java.io.File outputDirectory
          The output directory of the packaged titanium files.
protected  java.lang.String platform
          The platform for which the code should be packaged.
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  java.util.List remoteRepositories
           
protected  TitaniumSettings titaniumSettings
          The titanium settings.
protected  java.lang.String titaniumVersion
          The titanium SDK version to use.
protected  VirtualDevice virtualDevice
          Virtual device configuration.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractTitaniumPackageMojo()
           
 
Method Summary
protected  boolean checkPomSettings()
          Check the titanium pom settings.
protected  void downloadTitaniumFromRepositories(java.lang.String tiVersion, java.io.File targetDir)
           
protected  void extractZipFile(java.io.File zipFile, java.io.File destFolder)
           
protected  java.lang.String getAndroidAPI()
          Retrieve the android API to use when building the application.
protected  java.lang.String getIosVersion()
          Retrieve the ios platform version.
protected  java.io.File getTiProjectDirectory()
          Retrieve the titanium project folder for the specified platform.
protected  TitaniumSettings getTitaniumSettings()
          Retrieve the TitaniumSettings object.
protected  VirtualDevice getVirtualDevice()
          Retrieve the VirtualDevice object.
protected  java.io.File resolveAndroidBuilder()
           
protected  java.io.File resolveIOSBuilder()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

platform

protected java.lang.String platform

The platform for which the code should be packaged.

Supported platforms are:

android
Package for the android platform.
iphone
Package for the iPhone platform.
ipad
Package for the iPad platform.
universal
Package for iPhone and iPad.

Is defined by:
expression:
${platform}
Is required.

androidAPI

protected java.lang.String androidAPI

The version of the platform for which the code should be compiled.

This is the version of the library to use to compile the application. It's possible to specify another android API for the android virtual device. See VirtualDevice.androidAPI.

Is defined by:
expression:
${androidAPI}

iosVersion

protected java.lang.String iosVersion
The version of the platform for which the code should be compiled.

Is defined by:
expression:
${iosVersion}

titaniumVersion

protected java.lang.String titaniumVersion
The titanium SDK version to use.

Is defined by:
expression:
${titaniumVersion}
Is required.

titaniumSettings

protected TitaniumSettings titaniumSettings

The titanium settings.

Contains various information needed to execute a titanium build.

Here's the list of the titaniumSettings parameters:

TitaniumSettings.androidBuilder
The titanium android builder.py file location. Optional. If not specified it tries to retrieve the builder based on titaniumVersion
TitaniumSettings.iosBuilder
The titanium iOS builder.py location. Optional. If not specified, it tries to retrieve the builder based on titaniumVersion
TitaniumSettings.androidSDK
The android SDK location. This parameter is optional, by default the android SDK is retrieved based on the environment variable ANDROID_HOME.
TitaniumSettings.keystore
The android keystore to use to sign the application. Optional. If not specified the Titanium keystore is used.
TitaniumSettings.keystorePassword
The android keystore password. Optional. If not specified the default titanium keystore password is used.
TitaniumSettings.keystoreAlias
The android keystore key alias. Optional. The alias of the key to use to sign the application. If not specified the default titanium alias is used.
TitaniumSettings.iosDevelopmentProvisioningProfile
The iOS development provisioning profile. This profile is use when executeMode is virtual or device.
TitaniumSettings.iosDistributionProvisioningProfile
The iOS distribution provisioning profile. This profile is used when executeMode is none.
TitaniumSettings.iosDevelopmentCertificate
The iOS development certificate. This certificate is used when executeMode is virtual or device.
TitaniumSettings.iosDistributionCertificate
The iOS distribution certificate. This certificate is used when executeMode is none.

Is defined by:

virtualDevice

protected VirtualDevice virtualDevice

Virtual device configuration.

When executeMode is virtual, the parameters in virtualDevice are used to configure the android emulator or iphone simulator.

VirtualDevice has the following parameters:

VirtualDevice.androidAPI
The version on which the virtual device should run. If not specified, the latest android API version will be used. Regardless of the global androidAPI value.
VirtualDevice.iosVersion
The ios version of the virtual device. If not specified the latest available version will be used. Regardless of the global parameter value.
VirtualDevice.skin
The skin of the android emulator. Defaults to HVGA for version less than 10 and to WXGA for version greater than 10
VirtualDevice.family
The iOS device family. Valid values are iphone or ipad.
VirtualDevice.wait
How much miliseconds to wait after launching emulator before installing the android application.

See Also:
VirtualDevice
Is defined by:

executeMode

protected java.lang.String executeMode

The package execution mode.

Allow the execution of the package on an emulator/device.

Values are:

none
Do not execute. (Default value)
virtual
Execute on an emulator whose settings are specified in virtualDevice.
device
Execute on a connected device.

Is defined by:
expression:
${executeMode}
default-value:
none

outputDirectory

protected java.io.File outputDirectory
The output directory of the packaged titanium files.

Is defined by:
default-value:
${project.build.outputDirectory}

iosDevelopmentCertificate

protected java.lang.String iosDevelopmentCertificate
The ios Development certificate.

Is defined by:
expression:
${iosDevelopmentCertificate}
Is readonly.

iosDistributionCertificate

protected java.lang.String iosDistributionCertificate
The ios Distribution certificate.

Is defined by:
expression:
${iosDistributionCertificate}
Is readonly.

project

protected org.apache.maven.project.MavenProject project
The maven project.

Is defined by:
expression:
${project}
Is readonly.
Is required.

artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
Is a Plexus component defined by:

artifactResolver

protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
Is a Plexus component defined by:

localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
Is defined by:
default-value:
${localRepository}
Is readonly.

remoteRepositories

protected java.util.List remoteRepositories
Is defined by:
default-value:
${project.remoteArtifactRepositories}
Is readonly.

iosDevelopmentProvisioningProfile

protected java.lang.String iosDevelopmentProvisioningProfile
The iOS development provisioning profile.

Is defined by:
expression:
${iosDevelopmentProvisioningProfile}
Is readonly.

iosDistributionProvisioningProfile

protected java.lang.String iosDistributionProvisioningProfile
The ios distribution provisioning profile.

Is defined by:
expression:
${iosDistributionProvisioningProfile}
Is readonly.
Constructor Detail

AbstractTitaniumPackageMojo

public AbstractTitaniumPackageMojo()
Method Detail

getIosVersion

protected java.lang.String getIosVersion()

Retrieve the ios platform version.

If the ios platform version is not specified, retrieve one from the XCode installation.

Returns:
The iOS platform version.

getAndroidAPI

protected java.lang.String getAndroidAPI()
                                  throws org.apache.maven.plugin.MojoExecutionException

Retrieve the android API to use when building the application.

If the android API is not specified, the latest one is retrieved based on the Android SDK location.

Returns:
The android API level.
Throws:
org.apache.maven.plugin.MojoExecutionException

getTiProjectDirectory

protected java.io.File getTiProjectDirectory()
Retrieve the titanium project folder for the specified platform.

Returns:
A File representing the titanium project folder.

getTitaniumSettings

protected TitaniumSettings getTitaniumSettings()

Retrieve the TitaniumSettings object.

If titaniumSettings is null, a new TitaniumSettings is constructed based on the specified expressions.

Returns:
An initialized TitaniumSettings object.
See Also:
androidSDKPath, iosBuilderPath, androidBuilderPath, titaniumSettingsKeystore, titaniumSettingsKeystorePassword, titaniumSettingsKeystoreAlias

getVirtualDevice

protected VirtualDevice getVirtualDevice()

Retrieve the VirtualDevice object.

If virtualDevice is null, a new VirtualDevice is constructed based on the specified expressions.

Returns:
An initialized VirtualDevice object.
See Also:
virtualDeviceAndroidAPI, virtualDeviceFamily, virtualDeviceIosVersion, virtualDeviceSkin, virtualDeviceWait

checkPomSettings

protected boolean checkPomSettings()
                            throws org.apache.maven.plugin.MojoExecutionException

Check the titanium pom settings.

Mainly check if the androidAPI or the iosVersion parameters are valid.

Returns:
true if the pom settings are not valid.
Throws:
org.apache.maven.plugin.MojoExecutionException - If an error occurs.

downloadTitaniumFromRepositories

protected void downloadTitaniumFromRepositories(java.lang.String tiVersion,
                                                java.io.File targetDir)
                                         throws org.apache.maven.artifact.resolver.ArtifactResolutionException,
                                                org.apache.maven.artifact.resolver.ArtifactNotFoundException,
                                                java.io.IOException
Throws:
org.apache.maven.artifact.resolver.ArtifactResolutionException
org.apache.maven.artifact.resolver.ArtifactNotFoundException
java.io.IOException

resolveAndroidBuilder

protected java.io.File resolveAndroidBuilder()
                                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

resolveIOSBuilder

protected java.io.File resolveIOSBuilder()
                                  throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

extractZipFile

protected void extractZipFile(java.io.File zipFile,
                              java.io.File destFolder)
                       throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2011 SOFTEC sa. All Rights Reserved.