[Lutinutil-commits] r1423 - in maven-i18n-plugin/trunk: . src/main/java/org/codelutin/i18n/plugin src/main/java/org/codelutin/i18n/plugin/parser src/site src/site/rst
Author: tchemit Date: 2009-04-17 09:08:13 +0000 (Fri, 17 Apr 2009) New Revision: 1423 Added: maven-i18n-plugin/trunk/src/site/rst/ maven-i18n-plugin/trunk/src/site/rst/Todo.rst maven-i18n-plugin/trunk/src/site/rst/index.rst Modified: maven-i18n-plugin/trunk/changelog.txt maven-i18n-plugin/trunk/pom.xml maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/AbstractI18nPlugin.java maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Generate.java maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Getter.java maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/parser/AbstractI18nParser.java maven-i18n-plugin/trunk/src/site/site.xml Log: - replace bundles paramters from tyep String[] to String type to make easier configuration - use lutinproject 3.5.xx - use lutinpluginutil 0.4 Modified: maven-i18n-plugin/trunk/changelog.txt =================================================================== --- maven-i18n-plugin/trunk/changelog.txt 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/changelog.txt 2009-04-17 09:08:13 UTC (rev 1423) @@ -1,3 +1,8 @@ +0.11 chemit 20090311 + * 20090417 [chemit] - replace bundles paramters from tyep String[] to String type to make easier configuration + - use lutinproject 3.5.xx + - use lutinpluginutil 0.4 + 0.10 chemit 20090311 * 20090223 [chemit] will skip get and gen goal if no getters were registred while parsing goals 0.9 chemit 20090218 Modified: maven-i18n-plugin/trunk/pom.xml =================================================================== --- maven-i18n-plugin/trunk/pom.xml 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/pom.xml 2009-04-17 09:08:13 UTC (rev 1423) @@ -9,7 +9,7 @@ <parent> <groupId>org.codelutin</groupId> <artifactId>lutinproject</artifactId> - <version>3.4</version> + <version>3.5.2</version> </parent> <artifactId>maven-i18n-plugin</artifactId> @@ -46,7 +46,7 @@ <scope>compile</scope> </dependency> - <dependency> + <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>${maven.version}</version> @@ -88,7 +88,7 @@ <maven.version>2.0.10</maven.version> <processor.version>0.17</processor.version> - <lutinpluginutil.version>0.3</lutinpluginutil.version> + <lutinpluginutil.version>0.4-SNAPSHOT</lutinpluginutil.version> </properties> <build> @@ -99,7 +99,6 @@ <!-- plugin plugin --> <plugin> <artifactId>maven-plugin-plugin</artifactId> - <version>2.4.3</version> <executions> <execution> <goals> @@ -109,21 +108,20 @@ </executions> </plugin> - <!-- Always process jrst files, but only called on pre-site phase --> + <!-- plugin site --> <plugin> - <groupId>org.codelutin</groupId> - <artifactId>maven-jrst-plugin</artifactId> - <version>0.8.4</version> + <artifactId>maven-site-plugin</artifactId> <configuration> - <defaultLocale>fr</defaultLocale> + <locales>fr</locales> + <siteDirectory>src/site</siteDirectory> </configuration> - <executions> - <execution> - <goals> - <goal>jrst</goal> - </goals> - </execution> - </executions> + <dependencies> + <dependency> + <groupId>org.codelutin</groupId> + <artifactId>doxia-module-jrst</artifactId> + <version>1.0.0</version> + </dependency> + </dependencies> </plugin> </plugins> </build> Modified: maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/AbstractI18nPlugin.java =================================================================== --- maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/AbstractI18nPlugin.java 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/AbstractI18nPlugin.java 2009-04-17 09:08:13 UTC (rev 1423) @@ -15,7 +15,6 @@ * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ - package org.codelutin.i18n.plugin; import org.apache.maven.plugin.AbstractMojo; @@ -23,7 +22,6 @@ import java.io.File; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -38,16 +36,13 @@ * Le nombre de getters détectés pendant le cycle de vie du build. */ private static int NB_GETTER_FILES = 0; - /** * Répertoire de stockage des fichiers i18n pour la recuperation des fichiers * de traduction entre librairie */ protected static final String DIRECTORY_INSTALL = "i18n" + File.separatorChar; - /** les bundles par defaut utilisés, si aucun bundle n'est renseigné. */ - protected static final String[] DEFAULT_BUNDLES = new String[]{"fr_FR", "en_GB"}; - + //protected static final String[] DEFAULT_BUNDLES = new String[]{"fr_FR", "en_GB"}; /** * Nom du projet. * @@ -55,16 +50,14 @@ * @readonly */ protected String artifactId; - /** * Langues des bundles generes. * <p/> - * Note: Si aucun bundle n'est definie, on utilise par defaut {@link #DEFAULT_BUNDLES}. * - * @parameter expression="${i18n.bundles}" + * @parameter expression="${i18n.bundles}" default-value="fr_FR,en_GB" + * @required */ - protected String[] bundles = DEFAULT_BUNDLES; - + protected String bundles; /** * Repertoire sources des fichiers i18n. * @@ -72,7 +65,6 @@ * @required */ protected File src; - /** * Repertoire des fichiers generes i18n. * @@ -80,7 +72,6 @@ * @required */ protected File out; - /** * encoding a utiliser pour charger et sauver les bundles * @@ -88,7 +79,6 @@ * @required */ protected String encoding; - /** * Met les fichiers generes dans le repertoire des sources i18n. * <p/> @@ -97,7 +87,6 @@ * @parameter expression="${i18n.genSrc}" default-value="true" */ protected boolean genSrc; - /** * Active la modification de cle. * <p/> @@ -106,7 +95,6 @@ * @parameter expression="${i18n.keysModifier}" default-value="false" */ protected boolean keysModifier; - /** * verbose flag * <p/> @@ -115,7 +103,6 @@ * @parameter expression="${i18n.verbose}" default-value="${maven.verbose}" */ protected boolean verbose; - /** * conserve les anciens fichiers de traduction avec un suffix ~ * <p/> @@ -124,7 +111,6 @@ * @parameter expression="${i18n.keepBackup}" default-value="false" */ protected boolean keepBackup; - /** * ne conserve que les clef scannees (et donc traite tous les fichiers) * @@ -134,10 +120,9 @@ * @parameter expression="${i18n.strictMode}" default-value="false" */ protected boolean strictMode; - /** Liste des évènements */ protected List<ParserEvent> events = new ArrayList<ParserEvent>(); - + protected String[] bundlesToUse; /**logger verbeux */ protected I18nLogger verboseLog; @@ -162,16 +147,13 @@ public void init() { verboseLog = new I18nLogger(this); - + if (verbose) { getLog().info("config - verbose mode is on"); } - // set default bundle in none specified - if (bundles == null || bundles.length == 0 || (bundles.length == 1 && (bundles[0] == null || bundles[0].trim().isEmpty()))) { - if (verbose) { - getLog().info("config - use default bundles " + Arrays.toString(DEFAULT_BUNDLES)); - } - bundles = DEFAULT_BUNDLES; + bundlesToUse = bundles.split(","); + for (int i = 0, j = bundlesToUse.length; i < j; i++) { + bundlesToUse[i] = bundlesToUse[i].trim(); } } @@ -184,8 +166,8 @@ * @return <code>true</code> si des getters ont etes enregistres pendant * le cycle de vie, <code>false</code> sinon. */ - protected boolean needGeneration(){ - boolean needGeneration = NB_GETTER_FILES > 0; + protected boolean needGeneration() { + boolean needGeneration = NB_GETTER_FILES > 0; return needGeneration; } @@ -202,5 +184,4 @@ protected I18nLogger getVerboseLog() { return verboseLog; } - } Modified: maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Generate.java =================================================================== --- maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Generate.java 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Generate.java 2009-04-17 09:08:13 UTC (rev 1423) @@ -51,7 +51,7 @@ return; } - for (String bundle : bundles) { + for (String bundle : bundlesToUse) { try { // Merge File bundleSrc = PluginHelper.getI18nFile(src, artifactId, bundle, false); Modified: maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Getter.java =================================================================== --- maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Getter.java 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/Getter.java 2009-04-17 09:08:13 UTC (rev 1423) @@ -74,7 +74,7 @@ } // Création des bundles - for (String bundle : bundles) { + for (String bundle : bundlesToUse) { File bundleOut = PluginHelper.getI18nFile(out, artifactId, bundle, false); FileUtil.copy(bundleGetters, bundleOut); if (verbose) { Modified: maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/parser/AbstractI18nParser.java =================================================================== --- maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/parser/AbstractI18nParser.java 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/src/main/java/org/codelutin/i18n/plugin/parser/AbstractI18nParser.java 2009-04-17 09:08:13 UTC (rev 1423) @@ -153,7 +153,7 @@ // Anciennes cles disponnibles //fixme : pourquoi on utilise un bundle precis ? le premier ici, je ne comprends pas - File oldLanguageFile = PluginHelper.getI18nFile(src, artifactId, bundles[0], true); + File oldLanguageFile = PluginHelper.getI18nFile(src, artifactId, bundlesToUse[0], true); oldLanguage.load(oldLanguageFile); Copied: maven-i18n-plugin/trunk/src/site/rst/Todo.rst (from rev 1409, maven-i18n-plugin/trunk/src/site/fr/rst/Todo.rst) =================================================================== --- maven-i18n-plugin/trunk/src/site/rst/Todo.rst (rev 0) +++ maven-i18n-plugin/trunk/src/site/rst/Todo.rst 2009-04-17 09:08:13 UTC (rev 1423) @@ -0,0 +1,4 @@ +TODO +==== + +Any idea ? Property changes on: maven-i18n-plugin/trunk/src/site/rst/Todo.rst ___________________________________________________________________ Name: svn:mergeinfo + Copied: maven-i18n-plugin/trunk/src/site/rst/index.rst (from rev 1409, maven-i18n-plugin/trunk/src/site/fr/rst/index.rst) =================================================================== --- maven-i18n-plugin/trunk/src/site/rst/index.rst (rev 0) +++ maven-i18n-plugin/trunk/src/site/rst/index.rst 2009-04-17 09:08:13 UTC (rev 1423) @@ -0,0 +1,40 @@ +Introduction +------------ + +Maven I18n Plugin +================= + +The Maven I18n Plugin is used to compute i18n bundles for a given maven module. + +Goals Overview +~~~~~~~~~~~~~~ + +The I18n plugin has the following goals: + + * **i18n:parserJava** parse Java sources. + + * **i18n:parserJaxx** parse Jaxx sources. + + * **i18n:parserSwixat** parse Jaxx sources. + + * **i18n:parserValidation** parse XWorks validation sources. + + * **i18n:parserJavaActionConfig** parse des actions jaxx. + + * **i18n:parserJavaTabConfig** parse des onglets jaxx. + + * **i18n:get** assembly getter computed by parser-like goals. + + * **i18n:gen** generate i18n bundle from getters. + + * **i18n:help** display help. + +Usage +~~~~~ + +Instructions on how to use the Help Plugin can be found in **usages** page. + +Examples +~~~~~~~~ + + to be done. Property changes on: maven-i18n-plugin/trunk/src/site/rst/index.rst ___________________________________________________________________ Name: svn:mergeinfo + Modified: maven-i18n-plugin/trunk/src/site/site.xml =================================================================== --- maven-i18n-plugin/trunk/src/site/site.xml 2009-04-17 09:08:10 UTC (rev 1422) +++ maven-i18n-plugin/trunk/src/site/site.xml 2009-04-17 09:08:13 UTC (rev 1423) @@ -40,6 +40,7 @@ <item name="parserSwixat" href="parserSwixat-mojo.html"/> <item name="parserJavaActionConfig" href="parserJavaActionConfig-mojo.html"/> <item name="parserJavaTabConfig" href="parserJavaTabConfig-mojo.html"/> + <item name="parserXWorks" href="parserValidation-mojo.html"/> <item name="get" href="get-mojo.html"/> <item name="gen" href="gen-mojo.html"/> <item name="help" href="help-mojo.html"/>
participants (1)
-
tchemit@users.labs.libre-entreprise.org