org.nanoko.coffee.mill.mojos.packaging
Class JavaScriptMinifierMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nanoko.coffee.mill.mojos.AbstractCoffeeMillMojo
          extended by org.nanoko.coffee.mill.mojos.packaging.JavaScriptMinifierMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class JavaScriptMinifierMojo
extends AbstractCoffeeMillMojo

Minify JavaScript sources. It can use Google Closure or YUI Compressor. The minified file is attached to the project using the min classifier, except if the attachMinifiedJavaScript parameter is set to false


Nested Class Summary
static class JavaScriptMinifierMojo.Minifier
           
 
Field Summary
protected  boolean attachMinifiedJavaScript
          Enables / Disables the attachment of the minified file to the Maven project.
protected  JavaScriptMinifierMojo.Minifier minifier
          The JavaScript minifier to use among GOOGLE_CLOSURE (default) and YUI_COMPRESSOR.
protected  com.google.javascript.jscomp.CompilationLevel minifierGoogleCompilationLevel
          Selects the compilation level for Google Closure among SIMPLE_OPTIMIZATIONS, WHITESPACE_ONLY and ADVANCED_OPTIMIZATIONS.
protected  boolean minifierYUIDisableOptimizations
          YUI Options to disable the optimizations.
protected  boolean minifierYUIMunge
          YUI Options to enable / disable the munge mode.
protected  boolean minifierYUIPreserveSemiColumn
          YUI Option to preserve all semi columns.
protected  boolean minifierYUIVerbose
          YUI Option to enable the verbose mode.
protected  boolean skipMinification
          Enables to skip the minification phase.
 
Fields inherited from class org.nanoko.coffee.mill.mojos.AbstractCoffeeMillMojo
assetsDir, baseDirectory, buildDirectory, coffeeScriptDir, coffeeScriptTestDir, javaScriptDir, javaScriptTestDir, libDir, project, projectHelper, stylesheetsDir, workDir, workTestDir
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
JavaScriptMinifierMojo()
           
 
Method Summary
 void execute()
           
protected  com.google.javascript.jscomp.CompilerOptions newCompilerOptions()
           
 
Methods inherited from class org.nanoko.coffee.mill.mojos.AbstractCoffeeMillMojo
getLibDirectory, getTarget, getWorkDirectory, getWorkTestDirectory
 
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

skipMinification

protected boolean skipMinification
Enables to skip the minification phase.


attachMinifiedJavaScript

protected boolean attachMinifiedJavaScript
Enables / Disables the attachment of the minified file to the Maven project. Enabled by default.


minifier

protected JavaScriptMinifierMojo.Minifier minifier
The JavaScript minifier to use among GOOGLE_CLOSURE (default) and YUI_COMPRESSOR.


minifierYUIPreserveSemiColumn

protected boolean minifierYUIPreserveSemiColumn
YUI Option to preserve all semi columns. Disabled by default. This parameter is ignored on the GOOGLE minifier.


minifierYUIVerbose

protected boolean minifierYUIVerbose
YUI Option to enable the verbose mode. Disabled by default. This parameter is ignored on the GOOGLE minifier.


minifierYUIMunge

protected boolean minifierYUIMunge
YUI Options to enable / disable the munge mode. Enabled by default. This parameter is ignored on the GOOGLE minifier.


minifierYUIDisableOptimizations

protected boolean minifierYUIDisableOptimizations
YUI Options to disable the optimizations. Disabled by default (so optimizations enabled). This parameter is ignored on the GOOGLE minifier.


minifierGoogleCompilationLevel

protected com.google.javascript.jscomp.CompilationLevel minifierGoogleCompilationLevel
Selects the compilation level for Google Closure among SIMPLE_OPTIMIZATIONS, WHITESPACE_ONLY and ADVANCED_OPTIMIZATIONS. Be aware that ADVANCED_OPTIMIZATIONS modifies the API. This option is ignored on the YUI minifier.

Constructor Detail

JavaScriptMinifierMojo

public JavaScriptMinifierMojo()
Method Detail

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

newCompilerOptions

protected com.google.javascript.jscomp.CompilerOptions newCompilerOptions()
Returns:
default CompilerOptions object to be used by compressor.


Copyright © 2012-2013 OW2. All Rights Reserved.