info.rvin.mojo.flexmojo.compiler
Class AbstractFlexCompilerMojo<E extends flex2.tools.oem.Builder>

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by info.rvin.mojo.flexmojo.AbstractIrvinMojo
          extended by info.rvin.mojo.flexmojo.compiler.AbstractFlexCompilerMojo<E>
All Implemented Interfaces:
FlexMojo, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ApplicationMojo, LibraryMojo

public abstract class AbstractFlexCompilerMojo<E extends flex2.tools.oem.Builder>
extends AbstractIrvinMojo
implements FlexMojo


Field Summary
protected  E builder
          Builder to be used by compiler
protected  java.lang.String[] compiledLocales
          Sets the locales that the compiler uses to replace {locale} tokens that appear in some configuration values.
protected  java.io.File configFile
          Load a file containing configuration options If not defined, by default will search for one on resources folder.
protected  flex2.tools.oem.Configuration configuration
          Flex OEM compiler configurations
protected  org.apache.maven.execution.MavenSession context
          LW : needed for expression evaluation The maven MojoExecution needed for ExpressionEvaluation
protected  java.lang.String debugPassword
          A password that is embedded in the application
protected  org.apache.maven.plugin.MojoExecution execution
          LW : needed for expression evaluation Note : needs at least maven 2.0.8 because of MNG-3062 The maven MojoExecution needed for ExpressionEvaluation
protected  boolean isSetProjectFile
          When true sets the artifact generated by this mojos as pom artifact
protected  boolean linkReport
          Uses the default compiler options as base
protected  java.io.File linkReportFile
          Generated link report file
protected  MavenArtifact[] loadExterns
          Sets a list of artifacts to omit from linking when building an application.
protected  java.lang.String[] locales
          Deprecated.  
protected  java.lang.String resourceBundlePath
          Define the base path to locate resouce bundle files Accept some special tokens: {locale} - replace by locale name
protected  java.lang.String[] runtimeLocales
          Sets the locales that should be used to generate resource bundles.
protected  java.io.File[] sourcePaths
          List of path elements that form the roots of ActionScript class hierarchies.
 
Fields inherited from class info.rvin.mojo.flexmojo.AbstractIrvinMojo
artifactFactory, artifactMetadataSource, build, localRepository, mavenProjectBuilder, pluginArtifacts, project, projectHelper, remoteRepositories, resolver
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractFlexCompilerMojo()
          Construct instance
 
Method Summary
protected  void build(E builder)
           
protected  void configure()
          Setup builder configuration
protected abstract  java.lang.String getDefaultLocale()
           
protected  java.io.File[] getDependenciesPath(java.lang.String scope)
          Get array of files for dependency artfacts for given scope
 java.lang.String getFDKVersion()
           
protected  java.io.File getFontsSnapshot()
          Get Fonts snapshot
protected  java.io.File[] getGlobalDependency()
           
protected abstract  java.io.File getOutput()
           
protected  java.io.File[] getResourcesBundles(java.lang.String... requestedLocales)
          Get resource bundles for the given locale
protected  java.io.File[] getThemes()
           
protected  java.util.List<java.io.File> getValidSourceRoots(java.util.List<?> sourceRoots)
           
protected abstract  boolean isApplication()
           
protected abstract  boolean isDebug()
           
protected  void resolveDependencies()
           
 void rslsSort(java.util.List<org.apache.maven.artifact.Artifact> rslArtifacts)
           
 void run()
          Perform compilation of Flex source
protected  void setLocales(java.lang.String... locales)
           
 void setUp()
          Setup before compilation of source
protected  void tearDown()
          Perform actions after compilation has run
protected abstract  void writeResourceBundle(java.lang.String[] bundles, java.lang.String locale, java.io.File localePath)
          Write resource bundle
 
Methods inherited from class info.rvin.mojo.flexmojo.AbstractIrvinMojo
execute, getDependencyArtifacts, getDependencyArtifacts
 
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, getLog, setLog
 

Field Detail

execution

protected org.apache.maven.plugin.MojoExecution execution
LW : needed for expression evaluation Note : needs at least maven 2.0.8 because of MNG-3062 The maven MojoExecution needed for ExpressionEvaluation


context

protected org.apache.maven.execution.MavenSession context
LW : needed for expression evaluation The maven MojoExecution needed for ExpressionEvaluation


locales

protected java.lang.String[] locales
Deprecated. 
Sets the locales that the compiler uses to replace {locale} tokens that appear in some configuration values. This is equivalent to using the compiler.locale option of the mxmlc or compc compilers.
Usage:
 <locales>
    <locale>en_US</locale>
    <locale>pt_BR</locale>
    <locale>es_ES</locale>
 </locales>
 


sourcePaths

protected java.io.File[] sourcePaths
List of path elements that form the roots of ActionScript class hierarchies.
Usage:
 <sourcePaths>
    <path>${baseDir}/src/main/flex</path>
 </sourcePaths>
 
By default use Maven source and resources folders.


debugPassword

protected java.lang.String debugPassword
A password that is embedded in the application


linkReport

protected boolean linkReport
Uses the default compiler options as base


loadExterns

protected MavenArtifact[] loadExterns
Sets a list of artifacts to omit from linking when building an application. This is equivalent to using the load-externs option of the mxmlc or compc compilers.
Usage:
 <loadExterns>
   <loadExtern>
     <groupId>com.acme</groupId>
     <artifactId>flexmodule</artifactId>
     <version>1.0.0</version>
   </loadExtern>
   <loadExtern>
     <groupId>org.tabajara</groupId>
     <artifactId>flexmodule</artifactId>
     <version>1.0.0</version>
   </loadExtern>
 </loadExterns>
 


configFile

protected java.io.File configFile
Load a file containing configuration options If not defined, by default will search for one on resources folder. If not found an empty config file will be generated at target folder. This file doesn't reflect the configurations defined on pom.xml, is only put there because flex-compiler-oem always try to read a config.xml.


resourceBundlePath

protected java.lang.String resourceBundlePath
Define the base path to locate resouce bundle files Accept some special tokens:
 {locale}     - replace by locale name
 


builder

protected E extends flex2.tools.oem.Builder builder
Builder to be used by compiler


configuration

protected flex2.tools.oem.Configuration configuration
Flex OEM compiler configurations


isSetProjectFile

protected boolean isSetProjectFile
When true sets the artifact generated by this mojos as pom artifact


linkReportFile

protected java.io.File linkReportFile
Generated link report file


runtimeLocales

protected java.lang.String[] runtimeLocales
Sets the locales that should be used to generate resource bundles.
Usage:
 <runtimeLocales>
    <locale>en_US</locale>
    <locale>pt_BR</locale>
    <locale>es_ES</locale>
 </runtimeLocales>
 


compiledLocales

protected java.lang.String[] compiledLocales
Sets the locales that the compiler uses to replace {locale} tokens that appear in some configuration values. This is equivalent to using the compiler.locale option of the mxmlc or compc compilers.
Usage:
 <compiledLocales>
    <locale>en_US</locale>
    <locale>pt_BR</locale>
    <locale>es_ES</locale>
 </compiledLocales>
 

Constructor Detail

AbstractFlexCompilerMojo

public AbstractFlexCompilerMojo()
Construct instance

Method Detail

setUp

public void setUp()
           throws org.apache.maven.plugin.MojoExecutionException,
                  org.apache.maven.plugin.MojoFailureException
Setup before compilation of source

Specified by:
setUp in class AbstractIrvinMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getValidSourceRoots

protected java.util.List<java.io.File> getValidSourceRoots(java.util.List<?> sourceRoots)

run

public void run()
         throws org.apache.maven.plugin.MojoExecutionException,
                org.apache.maven.plugin.MojoFailureException
Perform compilation of Flex source

Specified by:
run in class AbstractIrvinMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

configure

protected void configure()
                  throws org.apache.maven.plugin.MojoExecutionException,
                         org.apache.maven.plugin.MojoFailureException
Setup builder configuration

Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getDefaultLocale

protected abstract java.lang.String getDefaultLocale()

isApplication

protected abstract boolean isApplication()

isDebug

protected abstract boolean isDebug()
Returns:
if should be compiled as debug

resolveDependencies

protected void resolveDependencies()
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getThemes

protected java.io.File[] getThemes()
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

setLocales

protected void setLocales(java.lang.String... locales)
                   throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getGlobalDependency

protected java.io.File[] getGlobalDependency()
                                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

rslsSort

public void rslsSort(java.util.List<org.apache.maven.artifact.Artifact> rslArtifacts)
              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getFontsSnapshot

protected java.io.File getFontsSnapshot()
                                 throws org.apache.maven.plugin.MojoExecutionException
Get Fonts snapshot

Returns:
File of font snapshot
Throws:
org.apache.maven.plugin.MojoExecutionException

getResourcesBundles

protected java.io.File[] getResourcesBundles(java.lang.String... requestedLocales)
                                      throws org.apache.maven.plugin.MojoExecutionException
Get resource bundles for the given locale

Parameters:
requestedLocales - the locale for which you want bundles, null for all locales
Returns:
Array of resource bundle files
Throws:
org.apache.maven.plugin.MojoExecutionException

getDependenciesPath

protected java.io.File[] getDependenciesPath(java.lang.String scope)
                                      throws org.apache.maven.plugin.MojoExecutionException
Get array of files for dependency artfacts for given scope

Parameters:
scope - for which to get files
Returns:
Array of dependency artifact files
Throws:
org.apache.maven.plugin.MojoExecutionException

tearDown

protected void tearDown()
                 throws org.apache.maven.plugin.MojoExecutionException,
                        org.apache.maven.plugin.MojoFailureException
Perform actions after compilation has run

Specified by:
tearDown in class AbstractIrvinMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

writeResourceBundle

protected abstract void writeResourceBundle(java.lang.String[] bundles,
                                            java.lang.String locale,
                                            java.io.File localePath)
                                     throws org.apache.maven.plugin.MojoExecutionException
Write resource bundle

Parameters:
bundles -
locale -
localePath -
Throws:
org.apache.maven.plugin.MojoExecutionException

build

protected void build(E builder)
              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getFDKVersion

public java.lang.String getFDKVersion()
Specified by:
getFDKVersion in interface FlexMojo

getOutput

protected abstract java.io.File getOutput()


Copyright © 2008-2009 Flex-Mojos. All Rights Reserved.