Permalink
Browse files

Added a skip parameter as well as better handling of when there's no …

…docs to assemble.
  • Loading branch information...
1 parent 25a1a5d commit 208c0f9ac850322d14c1480fce27f6bca956f9d1 @nawroth nawroth committed Dec 23, 2011
@@ -46,13 +46,20 @@
protected List<String> sourceDirectories;
/**
- * If filtering should be applied to files.
+ * Set to "true" to activate filtering.
*
* @parameter expression="${filter}" default-value="false"
*/
protected boolean filter;
/**
+ * Set to "true" to skip execution.
+ *
+ * @parameter expression="${skip}" default-value="false"
+ */
+ protected boolean skip;
+
+ /**
* The maven project.
*
* @parameter expression="${project}"
@@ -82,7 +89,19 @@
@Override
public void execute() throws MojoExecutionException
{
- DocsAssembler.assemble( sourceDirectories, filter, getLog(),
- session, project, projectHelper, resourceFiltering );
+ if ( skip )
+ {
+ skip();
+ }
+ else
+ {
+ DocsAssembler.assemble( sourceDirectories, filter, getLog(),
+ session, project, projectHelper, resourceFiltering );
+ }
+ }
+
+ protected void skip()
+ {
+ getLog().info( "Docs-plugin execution skipped." );
}
}
@@ -100,6 +100,11 @@ private File doAssembly( final List<String> sourceDirectories,
{
getLog().info( "Filtering is: " + ( filter ? "on" : "off" ) );
List<File> dirs = getDirectories( sourceDirectories );
+ if ( dirs.size() == 0 )
+ {
+ getLog().warn( "There are no docs to assemble." );
+ return null;
+ }
File destFile = null;
if ( filter )
@@ -63,6 +63,11 @@
@Override
public void execute() throws MojoExecutionException
{
+ if ( skip )
+ {
+ skip();
+ return;
+ }
if ( test != null )
{
getLog().info( "Preparing to execute test: " + test );

0 comments on commit 208c0f9

Please sign in to comment.