@Mojo(name="bundle",
defaultPhase=GENERATE_RESOURCES,
requiresProject=true,
requiresDependencyResolution=RUNTIME)
@Execute(goal="collect-i18n-artifacts")
public class BundleMojo
extends AbstractMakeI18nBundleMojo
| Modifier and Type | Field and Description |
|---|---|
protected File |
bundleCsvFile
Location of the csv file to generate if parameter
generateCsvFile is on. |
protected String |
bundleCsvSeparator
Char separator used when generating the csf bundle file if parameter
generateCsvFile is on. |
protected String |
bundleFormatConverter
Converter used to change format of bundles.
|
protected Map<String,BundleFormatConverter> |
bundleFormatConverters
Map of all availables
BundleFormatConverter. |
protected BundleFormatConverter |
converter
Format converter to apply if
|
protected boolean |
generateCsvFile
A flag to generate the i18n csv file wich contains all translation for
all locales.
|
protected boolean |
generateDefinitionFile
A flag to generate the i18n definition file.
|
bundleInputEncoding, bundleOutputDir, bundleOutputEncoding, bundleOutputName, bundleOutputPackage, checkBundle, failsIfWarning, generateDefaultLocale, outputFolder, showEmpty, unsafeMappingcollectOutputDir, collectOutputNameartifactId, bundles, encoding, genSrc, locales, out, project, silent, src, strictMode, verbose| Constructor and Description |
|---|
BundleMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyConversion(Properties properties)
Apply conversion over
properties with internal converter. |
protected void |
doAction() |
protected void |
generateCsvFile()
Generates a csv file with all translations.
|
protected void |
generateDefinitionFile(String version,
Map<Locale,String> bundleDico) |
protected File |
getBundleFile(File root,
String artifactId,
Locale locale,
boolean create)
Gets the bundle file for the given parameters.
|
protected URL[] |
getCollectI18nResources(Locale locale)
Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans
ses dépendances).
|
void |
init() |
failsIfWarning, generateDefaultBundle, getBundleInputEncoding, getBundleOutputEncoding, getBundleOutputFoldergetCollectOutputFileaddGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, isSilent, isStrictMode, isVerbose, needGeneration, setEncoding, setProject, setVerboseacceptPackaging, 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, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFilegetLog, getPluginContext, setLog, setPluginContext@Parameter(property="i18n.generateDefinitionFile",
defaultValue="true")
protected boolean generateDefinitionFile
@Parameter(property="i18n.generateCsvFile",
defaultValue="false")
protected boolean generateCsvFile
@Parameter(property="i18n.bundleCsvFile",
defaultValue="${basedir}/target/${project.artifactId}-i18n.csv")
protected File bundleCsvFile
generateCsvFile is on.@Parameter(property="i18n.bundleCsvSeparator",
defaultValue="\t")
protected String bundleCsvSeparator
generateCsvFile is on.@Parameter(property="i18n.bundleFormatConverter") protected String bundleFormatConverter
@Component(role=BundleFormatConverter.class) protected Map<String,BundleFormatConverter> bundleFormatConverters
BundleFormatConverter.protected BundleFormatConverter converter
public void init()
throws Exception
init in class AbstractMakeI18nBundleMojoExceptionprotected void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginExceptionprotected File getBundleFile(File root, String artifactId, Locale locale, boolean create) throws IOException
AbstractMakeI18nBundleMojogetBundleFile in class AbstractMakeI18nBundleMojoroot - the root directory where bundles are storedartifactId - the artifactId (says the prefix of bundle)locale - the locale used in bundle (null means no locale specialized)create - a flag to create the file if none existingIOException - if any IO problem while creating it (if needed).protected void generateDefinitionFile(String version, Map<Locale,String> bundleDico) throws IOException
IOExceptionprotected URL[] getCollectI18nResources(Locale locale) throws IOException
AbstractI18nBundleMojogetCollectI18nResources in class AbstractI18nBundleMojolocale - la locale a traiterIOExceptionprotected void applyConversion(Properties properties)
properties with internal converter.properties - Properties to walk throughprotected void generateCsvFile()
throws IOException
IOException - if any IO problem while the copy.Copyright © 2007-2013 CodeLutin. All Rights Reserved.