org.codehaus.mojo.javascript
Class TitaniumCompileMojo

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

public class TitaniumCompileMojo
extends CompileMojo

Goal that will place in a titanium build directory the file needed to create a titanium package.

Is defined by the goal name:
titanium-compile
Is bound to the specified phase of the standard build lifecycle:
compile
Plexus component:
role-hint:
"titanium"

Field Summary
protected  java.lang.String libsDirectory
          The folder for javascripts dependencies
protected  Tiapp tiapp
          The Titanium tiapp.xml configuration.
 
Fields inherited from class org.codehaus.mojo.javascript.CompileMojo
assemblerReaderManager, DEFAULT_INCLUDES, depsCount, depsDirectory, descriptor, descriptorFormat, excludes, includes, javascriptArtifactManager, outputDirectory, project, sourceDirectory, useArtifactId
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
TitaniumCompileMojo()
           
 
Method Summary
protected  int addScriptFile(org.codehaus.plexus.util.DirectoryScanner scanner, java.lang.String fileName, java.util.Set merged, java.io.PrintWriter writer)
           
protected  java.util.Set assemble(Assembler assembler)
           
protected  void assembleScripts(Assembler assembler, org.codehaus.plexus.util.DirectoryScanner scanner, org.codehaus.plexus.util.DirectoryScanner depsScan, java.util.Set merged)
           
protected  void copyUnmerged(java.util.Set merged)
           
 void execute()
          Perform the titanium compilation phase.
protected  java.io.File getPlatformOutputDirectory()
           
protected  java.lang.String getScriptsDir()
           
 
Methods inherited from class org.codehaus.mojo.javascript.CompileMojo
appendScriptFile, assemble, getJavascriptArtifactManager, getProject
 
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

tiapp

protected Tiapp tiapp
The Titanium tiapp.xml configuration. If not specified a default tiapp.xml file will be generated

Is defined by:

libsDirectory

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

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

TitaniumCompileMojo

public TitaniumCompileMojo()
Method Detail

getScriptsDir

protected java.lang.String getScriptsDir()

getPlatformOutputDirectory

protected java.io.File getPlatformOutputDirectory()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Perform the titanium compilation phase.

  1. Extract the dependencies in depsDirectory
  2. Copy the sourceDirectory files (using excludes and includes) to titaniumDirectory
  3. Move files located under "platform" folder outside of the platform folder. Based on the selected platform
  4. Assemble the files in one App.js file

Specified by:
execute in interface org.apache.maven.plugin.Mojo
Overrides:
execute in class CompileMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

copyUnmerged

protected void copyUnmerged(java.util.Set merged)
                     throws org.apache.maven.plugin.MojoExecutionException
Overrides:
copyUnmerged in class CompileMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

assemble

protected java.util.Set assemble(Assembler assembler)
                          throws org.apache.maven.plugin.MojoExecutionException
Overrides:
assemble in class CompileMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

assembleScripts

protected void assembleScripts(Assembler assembler,
                               org.codehaus.plexus.util.DirectoryScanner scanner,
                               org.codehaus.plexus.util.DirectoryScanner depsScan,
                               java.util.Set merged)
                        throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

addScriptFile

protected int addScriptFile(org.codehaus.plexus.util.DirectoryScanner scanner,
                            java.lang.String fileName,
                            java.util.Set merged,
                            java.io.PrintWriter writer)
                     throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2011 SOFTEC sa. All Rights Reserved.