Author: hboutemy
Date: Sun Dec 13 19:34:52 2015
New Revision: 1719821
URL: http://svn.apache.org/viewvc?rev=1719821&view=rev
Log:
[DOXIASITETOOLS-125] changed siteDirectory from String to File in
getDecorationModel()
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java?rev=1719821&r1=1719820&r2=1719821&view=diff
==============================================================================
---
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
(original)
+++
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/DefaultSiteTool.java
Sun Dec 13 19:34:52 2015
@@ -379,10 +379,9 @@ public class DefaultSiteTool
}
/** {@inheritDoc} */
- public DecorationModel getDecorationModel( MavenProject project,
List<MavenProject> reactorProjects,
- ArtifactRepository
localRepository,
- List<ArtifactRepository>
repositories, String siteDirectory,
- Locale locale )
+ public DecorationModel getDecorationModel( File siteDirectory, Locale
locale, MavenProject project,
+ List<MavenProject>
reactorProjects, ArtifactRepository localRepository,
+ List<ArtifactRepository>
repositories )
throws SiteToolException
{
checkNotNull( "project", project );
@@ -400,9 +399,8 @@ public class DefaultSiteTool
MavenProject parentProject = getParentProject( project,
reactorProjects, localRepository );
- DecorationModel decorationModel =
- getDecorationModel( project, parentProject, reactorProjects,
localRepository, repositories, siteDirectory,
- llocale, props );
+ DecorationModel decorationModel = getDecorationModel( siteDirectory,
llocale, project, parentProject,
+ reactorProjects,
localRepository, repositories, props );
if ( decorationModel == null )
{
@@ -1021,16 +1019,16 @@ public class DefaultSiteTool
* @param reactorProjects not null
* @param localRepository not null
* @param repositories not null
- * @param siteDirectory not null
+ * @param siteDirectory may be null
* @param locale not null
* @param origProps not null
* @return the decoration model depending the locale
* @throws SiteToolException if any
*/
- private DecorationModel getDecorationModel( MavenProject project,
MavenProject parentProject,
- List<MavenProject>
reactorProjects, ArtifactRepository localRepository,
- List<ArtifactRepository>
repositories, String siteDirectory,
- Locale locale, Map<String,
String> origProps )
+ private DecorationModel getDecorationModel( File siteDirectory, Locale
locale, MavenProject project,
+ MavenProject parentProject,
List<MavenProject> reactorProjects,
+ ArtifactRepository
localRepository,
+ List<ArtifactRepository>
repositories, Map<String, String> origProps )
throws SiteToolException
{
Map<String, String> props = new HashMap<String, String>( origProps );
@@ -1051,7 +1049,7 @@ public class DefaultSiteTool
}
else
{
- siteDescriptor = getSiteDescriptor( new File(
project.getBasedir(), siteDirectory ), locale );
+ siteDescriptor = getSiteDescriptor( siteDirectory, locale );
}
String siteDescriptorContent = null;
@@ -1091,9 +1089,8 @@ public class DefaultSiteTool
MavenProject parentParentProject = getParentProject(
parentProject, reactorProjects, localRepository );
- DecorationModel parent =
- getDecorationModel( parentProject, parentParentProject,
reactorProjects, localRepository, repositories,
- siteDirectory, locale, props );
+ DecorationModel parent = getDecorationModel( null, locale,
parentProject, parentParentProject,
+ reactorProjects,
localRepository, repositories, props );
// MSHARED-116 requires an empty decoration model (instead of a
null one)
// MSHARED-145 requires us to do this only if there is a parent to
merge it with
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java?rev=1719821&r1=1719820&r2=1719821&view=diff
==============================================================================
---
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
(original)
+++
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java
Sun Dec 13 19:34:52 2015
@@ -124,20 +124,19 @@ public interface SiteTool
/**
* Get a decoration model for a project.
*
+ * @param siteDirectory the site directory, may be <code>null</code>
+ * @param locale the locale used for the i18n in DecorationModel. If null,
using the default locale in the jvm.
* @param project the Maven project, not null.
* @param reactorProjects the Maven reactor projects, not null.
* @param localRepository the Maven local repository, not null.
* @param repositories the Maven remote repositories, not null.
- * @param siteDirectory The path to the directory containing the
<code>site.xml</code> file, relative to the
- * project base directory. If null, using by default "src/site".
- * @param locale the locale used for the i18n in DecorationModel. If null,
using the default locale in the jvm.
* @return the <code>DecorationModel</code> object corresponding to the
<code>site.xml</code> file with some
* interpolations.
* @throws SiteToolException if any
*/
- DecorationModel getDecorationModel( MavenProject project,
List<MavenProject> reactorProjects,
- ArtifactRepository localRepository,
List<ArtifactRepository> repositories,
- String siteDirectory, Locale locale )
+ DecorationModel getDecorationModel( File siteDirectory, Locale locale,
MavenProject project,
+ List<MavenProject> reactorProjects,
ArtifactRepository localRepository,
+ List<ArtifactRepository> repositories )
throws SiteToolException;
/**
Modified:
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java?rev=1719821&r1=1719820&r2=1719821&view=diff
==============================================================================
---
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
(original)
+++
maven/doxia/doxia-sitetools/trunk/doxia-integration-tools/src/test/java/org/apache/maven/doxia/tools/SiteToolTest.java
Sun Dec 13 19:34:52 2015
@@ -256,14 +256,12 @@ public class SiteToolTest
project.setGroupId( "org.apache.maven" );
project.setArtifactId( "maven-site" );
project.setVersion( "1.0" );
- String siteDirectory = "src/site";
List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
project.setBasedir( null ); // get it from repo
- DecorationModel model =
- tool.getDecorationModel( project, reactorProjects, getLocalRepo(),
project.getRemoteArtifactRepositories(),
- siteDirectory, Locale.getDefault() );
+ DecorationModel model = tool.getDecorationModel( null,
Locale.getDefault(), project, reactorProjects,
+ getLocalRepo(),
project.getRemoteArtifactRepositories() );
assertNotNull( model );
assertNotNull( model.getBannerLeft() );
assertEquals( "Maven", model.getBannerLeft().getName() );
@@ -289,8 +287,8 @@ public class SiteToolTest
List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
DecorationModel model =
- tool.getDecorationModel( project, reactorProjects, getLocalRepo(),
project.getRemoteArtifactRepositories(),
- siteDirectory, Locale.getDefault() );
+ tool.getDecorationModel( new File( project.getBasedir(),
siteDirectory ), Locale.getDefault(), project,
+ reactorProjects, getLocalRepo(),
project.getRemoteArtifactRepositories() );
assertNotNull( model );
}