org.codehaus.mojo.javascript
Class PrepareTitaniumJasmineTestMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.javascript.PrepareTitaniumJasmineTestMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class PrepareTitaniumJasmineTestMojo
extends org.apache.maven.plugin.AbstractMojo

This Mojo create the titanium project structure required to execute the jasmine tests.

Is defined by the goal name:
prepare-titanium-jasmine-tests
Is bound to the specified phase of the standard build lifecycle:
test-compile
Requires the dependencies in this specified scope:
test

Field Summary
protected static java.lang.String[] DEFAULT_INCLUDES
          default includes pattern
protected  java.io.File jasmineTestSourceDirectory
          The location of the javascript test files
protected  java.lang.String libsDirectory
          The folder for javascripts dependencies
protected  java.io.File outputDirectory
          The output directory of the assembled js file.
protected  java.lang.String platform
          The platform for which the code should be packaged.
protected  java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts
           
protected  java.util.List<java.lang.String> preloadSources
          JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.
protected  boolean skipTests
          Set this to 'true' to bypass unit tests entirely.
protected  java.io.File sourceDirectory
          Location of the source files.
protected  java.lang.String[] specExcludes
          Exclusion pattern.
protected  java.lang.String specsDirectory
          The output folder for jasmine spec files.
protected  java.io.File testOutputDirectory
          The output directory of the test files.
protected  boolean useArtifactId
          Use the artifactId as folder
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
PrepareTitaniumJasmineTestMojo()
           
 
Method Summary
protected  void copySpecFiles()
           
protected  void createTestAppJs(java.util.List<java.lang.String> sourceFiles)
           
protected  void ensureTiApp()
           
 void execute()
           
protected  java.io.File getPlatformTestOutputDirectory()
           
protected  java.io.File getPlatformTestSourceDirectory()
           
protected  java.io.File getTiProjectDirectory()
           
protected  java.io.File getTiProjectResourceDirectory()
           
 
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
 

Field Detail

DEFAULT_INCLUDES

protected static final java.lang.String[] DEFAULT_INCLUDES
default includes pattern


preloadSources

protected java.util.List<java.lang.String> preloadSources
JavaScript sources (typically vendor/lib dependencies) that need to be loaded before other sources (and specs) in a particular order, these are relative to the ${sourceDirectory} directory! Therefore, if jquery.js is in `${sourceDirectory}/vendor`, you would configure: <preloadSources> <source>vendor/z.js</source> </preloadSources> And z.js would load before all the other sources and specs.

Is defined by:

libsDirectory

protected java.lang.String libsDirectory
The folder for javascripts dependencies

Is defined by:
expression:
${scripts}
default-value:
lib

specsDirectory

protected java.lang.String specsDirectory
The output folder for jasmine spec files.

Is defined by:
expression:
${specs}
default-value:
specs

jasmineTestSourceDirectory

protected java.io.File jasmineTestSourceDirectory
The location of the javascript test files

Is defined by:
expression:
${jsunitTestSourceDirectory}
default-value:
${project.basedir}${file.separator}src${file.separator}test${file.separator}javascript

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.

sourceDirectory

protected java.io.File sourceDirectory
Location of the source files.

Is defined by:
default-value:
${basedir}/src/main/javascript

outputDirectory

protected java.io.File outputDirectory
The output directory of the assembled js file.

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

testOutputDirectory

protected java.io.File testOutputDirectory
The output directory of the test files.

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

pluginArtifacts

protected java.util.List<org.apache.maven.artifact.Artifact> pluginArtifacts
Is defined by:
default-value:
${plugin.artifacts}

skipTests

protected boolean skipTests
Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.

Is defined by:
expression:
${maven.test.skip}

specExcludes

protected java.lang.String[] specExcludes
Exclusion pattern.

Allow to specify which jasmine spec files should be excluded.

Is defined by:

useArtifactId

protected boolean useArtifactId
Use the artifactId as folder

Is defined by:
Constructor Detail

PrepareTitaniumJasmineTestMojo

public PrepareTitaniumJasmineTestMojo()
Method Detail

getPlatformTestSourceDirectory

protected java.io.File getPlatformTestSourceDirectory()

getPlatformTestOutputDirectory

protected java.io.File getPlatformTestOutputDirectory()

getTiProjectDirectory

protected java.io.File getTiProjectDirectory()

getTiProjectResourceDirectory

protected java.io.File getTiProjectResourceDirectory()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

ensureTiApp

protected void ensureTiApp()
                    throws java.io.IOException
Throws:
java.io.IOException

copySpecFiles

protected void copySpecFiles()
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

createTestAppJs

protected void createTestAppJs(java.util.List<java.lang.String> sourceFiles)
                        throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2011 SOFTEC sa. All Rights Reserved.