Author: fdesbois Date: 2011-05-10 22:39:58 +0200 (Tue, 10 May 2011) New Revision: 1919 Url: http://nuiton.org/repositories/revision/i18n/1919 Log: #1515 : Add AvailableConverterMojo for BundlerFormatConverter Added: trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/AvailableConverterMojo.java Modified: trunk/maven-i18n-plugin/src/it/evo-1507/README.txt trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties trunk/maven-i18n-plugin/src/it/settings.xml Modified: trunk/maven-i18n-plugin/src/it/evo-1507/README.txt =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/README.txt 2011-05-10 20:36:43 UTC (rev 1918) +++ trunk/maven-i18n-plugin/src/it/evo-1507/README.txt 2011-05-10 20:39:58 UTC (rev 1919) @@ -1,5 +1,5 @@ This it test the http://nuiton.org/issues/show/1507. -To test I18nFormatterMessageFormat and conversion from string.format syntax +To test BundlerFormatConverter and conversion from string.format syntax using StringFormatToMessageFormat. Modified: trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties =================================================================== --- trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties 2011-05-10 20:36:43 UTC (rev 1918) +++ trunk/maven-i18n-plugin/src/it/evo-1507/invoker.properties 2011-05-10 20:39:58 UTC (rev 1919) @@ -24,7 +24,7 @@ ### # A comma or space separated list of goals/phases to execute, may # specify an empty list to execute the default goal of the IT project -invoker.goals=clean test +invoker.goals=clean test i18n:available-converters # Optionally, a list of goals to run during further invocations of Maven #invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run Modified: trunk/maven-i18n-plugin/src/it/settings.xml =================================================================== --- trunk/maven-i18n-plugin/src/it/settings.xml 2011-05-10 20:36:43 UTC (rev 1918) +++ trunk/maven-i18n-plugin/src/it/settings.xml 2011-05-10 20:39:58 UTC (rev 1919) @@ -58,4 +58,9 @@ </pluginRepositories> </profile> </profiles> + + <pluginGroups> + <pluginGroup>org.nuiton.i18n</pluginGroup> + </pluginGroups> + </settings> Added: trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/AvailableConverterMojo.java =================================================================== --- trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/AvailableConverterMojo.java (rev 0) +++ trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/AvailableConverterMojo.java 2011-05-10 20:39:58 UTC (rev 1919) @@ -0,0 +1,79 @@ +/* + * #%L + * I18n :: Maven Plugin + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2007 - 2011 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * 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>. + * #L% + */ +package org.nuiton.i18n.plugin.bundle; + +import org.nuiton.plugin.AbstractAvailableDataMojo; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Map; + +/** + * Mojo used to display available {@link BundleFormatConverter}. + * <p/> + * Created: 09/05/11 + * + * @author fdesbois <desbois@codelutin.com> + * $Id$ + * @goal available-converters + * @requiresProject true + * @requiresDirectInvocation true + * @requiresDependencyResolution test + * @since 2.4 + */ +public class AvailableConverterMojo extends AbstractAvailableDataMojo { + + /** + * Map of all availables {@link BundleFormatConverter}. + * + * @component role="org.nuiton.i18n.plugin.bundle.BundleFormatConverter" + */ + protected Map<String, BundleFormatConverter> bundleFormatConverters; + + @Override + protected Collection<AvailableData> getAllAvailableDatas() { + + AvailableData data = new AvailableData() { + + @Override + public String name() { + return "bundleFormatConverter"; + } + + @Override + public Map<String, ?> getData() { + return bundleFormatConverters; + } + + @Override + public String toString(Object value) { + return value.getClass().getName(); + } + }; + + return Arrays.asList(data); + } + +} Property changes on: trunk/maven-i18n-plugin/src/main/java/org/nuiton/i18n/plugin/bundle/AvailableConverterMojo.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL