maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1719480 - in /maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site: ./ deploy/ render/ run/
Date Fri, 11 Dec 2015 17:49:20 GMT
Author: hboutemy
Date: Fri Dec 11 17:49:19 2015
New Revision: 1719480

URL: http://svn.apache.org/viewvc?rev=1719480&view=rev
Log:
code simplification

Modified:
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/EffectiveSiteMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/AbstractSiteMojo.java
Fri Dec 11 17:49:19 2015
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.List;
+import java.util.Locale;
 import java.util.Properties;
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -51,7 +52,7 @@ public abstract class AbstractSiteMojo
      * @since 2.3
      */
     @Parameter( property = "locales" )
-    protected String locales;
+    private String locales;
 
     /**
      * SiteTool.
@@ -67,7 +68,8 @@ public abstract class AbstractSiteMojo
 
     /**
      * Directory containing the <code>site.xml</code> file and the source for
hand written docs (one directory
-     * per Doxia-supported markup sources: see <a href="/doxia/references/index.html">Doxia
Markup Languages References</a>).
+     * per Doxia-supported markup sources:
+     * see <a href="/doxia/references/index.html">Doxia Markup Languages References</a>).
      *
      * @since 2.3
      */
@@ -160,4 +162,9 @@ public abstract class AbstractSiteMojo
 
         return properties.getProperty( "version" ).trim();
     }
+
+    protected List<Locale> getLocales()
+    {
+        return siteTool.getAvailableLocales( locales );
+    }
 }

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/EffectiveSiteMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/EffectiveSiteMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/EffectiveSiteMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/EffectiveSiteMojo.java
Fri Dec 11 17:49:19 2015
@@ -26,8 +26,6 @@ import java.io.Writer;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.List;
-import java.util.Locale;
 
 import org.apache.maven.doxia.site.decoration.DecorationModel;
 import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Writer;
@@ -74,9 +72,7 @@ public class EffectiveSiteMojo
 
         try
         {
-            List<Locale> localesList = siteTool.getAvailableLocales( locales );
-
-            SiteRenderingContext context = createSiteRenderingContext( localesList.get( 0
) );
+            SiteRenderingContext context = createSiteRenderingContext( getLocales().get(
0 ) );
 
             DecorationModel decorationModel = context.getDecoration();
 

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
Fri Dec 11 17:49:19 2015
@@ -22,7 +22,6 @@ package org.apache.maven.plugins.site;
 import java.io.File;
 import java.io.IOException;
 
-import java.util.List;
 import java.util.Locale;
 
 import org.apache.maven.plugin.MojoExecutionException;
@@ -74,9 +73,7 @@ public class SiteDescriptorAttachMojo
             return;
         }
 
-        List<Locale> localesList = siteTool.getAvailableLocales( locales );
-
-        for ( Locale locale : localesList )
+        for ( Locale locale : getLocales() )
         {
             File descriptorFile = siteTool.getSiteDescriptorFromBasedir(
                 siteTool.getRelativePath( siteDirectory.getAbsolutePath(), project.getBasedir().getAbsolutePath()
),

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/deploy/AbstractDeployMojo.java
Fri Dec 11 17:49:19 2015
@@ -321,8 +321,7 @@ public abstract class AbstractDeployMojo
                 }
             }
 
-            push( directory, repository, wagon, proxyInfo, siteTool.getAvailableLocales(
locales ),
-                  getDeployModuleDirectory() );
+            push( directory, repository, wagon, proxyInfo, getLocales(), getDeployModuleDirectory()
);
 
             if ( chmod )
             {

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/render/SiteMojo.java
Fri Dec 11 17:49:19 2015
@@ -130,7 +130,7 @@ public class SiteMojo
 
         try
         {
-            List<Locale> localesList = siteTool.getAvailableLocales( locales );
+            List<Locale> localesList = getLocales();
 
             // Default is first in the list
             Locale defaultLocale = localesList.get( 0 );

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java?rev=1719480&r1=1719479&r2=1719480&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/run/SiteRunMojo.java
Fri Dec 11 17:49:19 2015
@@ -157,7 +157,7 @@ public class SiteRunMojo
 
         List<MavenReportExecution> reports = getReports(); // TODO: is it sane to call
getReports() method a second time?
 
-        List<Locale> localesList = siteTool.getAvailableLocales( locales );
+        List<Locale> localesList = getLocales();
         webapp.setAttribute( DoxiaFilter.LOCALES_LIST_KEY, localesList );
 
         // Default is first in the list



Mime
View raw message