Class GenerateCsvBundleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding

@Mojo(name="generate-csv-bundle",
      defaultPhase=GENERATE_RESOURCES,
      requiresProject=true,
      requiresDependencyResolution=RUNTIME)
public class GenerateCsvBundleMojo
extends AbstractCsvBundleMojo
To generate a csv file from the full bundle of the module. The csv file will have a first column with i18n keys, and a column for each locale defined in AbstractI18nMojo.locales. Created on 7/26/14.
Since:
3.3
Author:
Tony Chemit - chemit@codelutin.com
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected boolean addInClassPath
    To add the generated csv file in the classpath.
    protected java.io.File bundleCsvDirectory
    If you want to specify where to generate the csv file.
    protected java.io.File bundleCsvFile
    The definitive file where to write the csv file.
    protected java.lang.String bundleCsvFileName
    Location of the csv file to split.
    protected java.lang.String bundleInputEncoding
    Encoding used to read any i18n property files.
    protected java.io.File bundleOutputDir
    Root directory where to generate aggregated bundles (this directory will be added as resources of the project).
    protected java.lang.String bundleOutputEncoding
    Encoding used to write any files.
    protected java.lang.String bundleOutputName
    Name of the bundle to use.
    protected java.lang.String bundleOutputPackage
    Package name of the generate aggregated bundles.
    protected java.io.File outputFolder
    The definitive directory where to load the bundles (includes the package of bundle).

    Fields inherited from class org.nuiton.i18n.plugin.bundle.csv.AbstractCsvBundleMojo

    bundleCsvSeparator

    Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo

    bundles, encoding, locales, mavenSession, project, silent, verbose

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors 
    Constructor Description
    GenerateCsvBundleMojo()  
  • Method Summary

    Modifier and Type Method Description
    protected void doAction()  
    protected java.io.File getBundleOutputFolder()  
    void init()  

    Methods inherited from class org.nuiton.plugin.AbstractPlugin

    acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile

    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 Details

    • bundleOutputName

      @Parameter(property="i18n.bundleOutputName", defaultValue="${project.artifactId}-i18n", required=true) protected java.lang.String bundleOutputName
      Name of the bundle to use.
    • bundleInputEncoding

      @Parameter(property="i18n.bundleInputEncoding") protected java.lang.String bundleInputEncoding
      Encoding used to read any i18n property files. If not defined, will use the AbstractI18nMojo.encoding parameter.
    • bundleOutputEncoding

      @Parameter(property="i18n.bundleOutputEncoding") protected java.lang.String bundleOutputEncoding
      Encoding used to write any files. If not defined, will use the AbstractI18nMojo.encoding parameter.
    • bundleOutputDir

      @Parameter(property="i18n.bundleOutputDir", defaultValue="${project.build.directory}/generated-sources/resources", required=true) protected java.io.File bundleOutputDir
      Root directory where to generate aggregated bundles (this directory will be added as resources of the project).
    • bundleOutputPackage

      @Parameter(property="i18n.bundleOutputPackage", defaultValue="META-INF", required=true) protected java.lang.String bundleOutputPackage
      Package name of the generate aggregated bundles. Note: By default we use the META-INF package since it is the favorite package of I18n runtime initializer. The package name is dotted as it will be stored as folder like in Java language. Example :
           package name : foo.bar
           directory    : foo/bar
       
    • addInClassPath

      @Parameter(property="i18n.addInClassPath", defaultValue="true") protected boolean addInClassPath
      To add the generated csv file in the classpath. If bundleCsvDirectory is filled, then will add the generated csv file at the root of class-path, otherwise will add add it in the bundleOutputPackage package.
    • bundleCsvFileName

      @Parameter(property="i18n.bundleCsvFile", defaultValue="${i18n.bundleOutputName}-i18n.csv", required=true) protected java.lang.String bundleCsvFileName
      Location of the csv file to split.
    • bundleCsvDirectory

      @Parameter(property="i18n.bundleCsvDirectory") protected java.io.File bundleCsvDirectory
      If you want to specify where to generate the csv file. If not filled, then will generate it in the same directory where bundles are stored.
    • outputFolder

      protected java.io.File outputFolder
      The definitive directory where to load the bundles (includes the package of bundle).
    • bundleCsvFile

      protected java.io.File bundleCsvFile
      The definitive file where to write the csv file.
  • Constructor Details

  • Method Details

    • init

      public void init() throws java.lang.Exception
      Overrides:
      init in class AbstractI18nMojo
      Throws:
      java.lang.Exception
    • doAction

      protected void doAction() throws java.lang.Exception
      Specified by:
      doAction in class org.nuiton.plugin.AbstractPlugin
      Throws:
      java.lang.Exception
    • getBundleOutputFolder

      protected java.io.File getBundleOutputFolder()