[MPLUGIN-117] Emphasize goal/parameter deprecation

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@657607 13f79535-47bb-0310-9956-ffa450edef68
master
Benjamin Bentmann 2008-05-18 18:48:39 +00:00
parent a28cef0e4b
commit 86aa89d224
2 changed files with 45 additions and 32 deletions

View File

@ -322,20 +322,20 @@ public class PluginReport
*/ */
String goalDocumentationLink = "./" + mojo.getGoal() + "-mojo.html"; String goalDocumentationLink = "./" + mojo.getGoal() + "-mojo.html";
String description = mojo.getDescription(); String description;
if ( StringUtils.isEmpty( description ) ) if ( StringUtils.isNotEmpty( mojo.getDeprecated() ) )
{ {
description = getBundle( locale ).getString( "report.plugin.goal.nodescription" ); description =
"<strong>" + getBundle( locale ).getString( "report.plugin.goal.deprecated" ) + "</strong> "
+ PluginUtils.makeHtmlValid( mojo.getDeprecated() );
}
else if ( StringUtils.isNotEmpty( mojo.getDescription() ) )
{
description = PluginUtils.makeHtmlValid( mojo.getDescription() );
} }
else else
{ {
description = PluginUtils.makeHtmlValid( description ); description = getBundle( locale ).getString( "report.plugin.goal.nodescription" );
}
String deprecated = mojo.getDeprecated();
if ( StringUtils.isNotEmpty( deprecated ) )
{
description = "<strong>" + getBundle( locale ).getString( "report.plugin.goal.deprecated" ) + "</strong> " + description;
} }
sink.tableRow(); sink.tableRow();

View File

@ -168,20 +168,30 @@ public class PluginXdocGenerator
+ mojoDescriptor.getPluginDescriptor().getVersion() + ":" + mojoDescriptor.getGoal() ); + mojoDescriptor.getPluginDescriptor().getVersion() + ":" + mojoDescriptor.getGoal() );
w.endElement(); //p w.endElement(); //p
if ( StringUtils.isNotEmpty( mojoDescriptor.getDeprecated() ) )
{
w.startElement( "p" );
w.writeMarkup( "<strong>" + getBundle( locale ).getString( "pluginxdoc.mojodescriptor.deprecated" )
+ "</strong>:" );
w.endElement(); // p
w.startElement( "div" );
w.writeMarkup( PluginUtils.makeHtmlValid( mojoDescriptor.getDeprecated() ) );
w.endElement(); // div
}
w.startElement( "p" ); w.startElement( "p" );
w.writeMarkup( "<strong>"+ getBundle( locale ).getString( "pluginxdoc.description" ) + "</strong>:" ); w.writeMarkup( "<strong>"+ getBundle( locale ).getString( "pluginxdoc.description" ) + "</strong>:" );
w.endElement(); //p w.endElement(); //p
w.startElement( "div" );
if ( StringUtils.isNotEmpty( mojoDescriptor.getDescription() ) ) if ( StringUtils.isNotEmpty( mojoDescriptor.getDescription() ) )
{ {
w.writeMarkup( PluginUtils.makeHtmlValid( mojoDescriptor.getDescription() ) ); w.writeMarkup( PluginUtils.makeHtmlValid( mojoDescriptor.getDescription() ) );
} }
else else
{ {
w.startElement( "p" );
w.writeText( getBundle( locale ).getString( "pluginxdoc.nodescription" ) ); w.writeText( getBundle( locale ).getString( "pluginxdoc.nodescription" ) );
w.endElement(); // p
} }
w.endElement(); // div
writeGoalAttributes( mojoDescriptor, w ); writeGoalAttributes( mojoDescriptor, w );
@ -214,13 +224,7 @@ public class PluginXdocGenerator
w.startElement( "ul" ); w.startElement( "ul" );
String value = mojoDescriptor.getDeprecated(); String value;
if ( StringUtils.isNotEmpty( value ) )
{
w.startElement( "li" );
w.writeMarkup( getBundle( locale ).getString( "pluginxdoc.mojodescriptor.deprecated" ) + ": " + value + "." );
w.endElement(); //li
}
if ( mojoDescriptor.isProjectRequired() ) if ( mojoDescriptor.isProjectRequired() )
{ {
@ -374,21 +378,28 @@ public class PluginXdocGenerator
w.writeMarkup( "<strong><a name=\"" + parameter.getName() + "\">" + parameter.getName() + "</a>:</strong>" ); w.writeMarkup( "<strong><a name=\"" + parameter.getName() + "\">" + parameter.getName() + "</a>:</strong>" );
w.endElement(); //p w.endElement(); //p
if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
{
w.startElement( "div" );
w.writeMarkup( "<strong>"
+ getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.deprecated" ) + ".</strong> "
+ PluginUtils.makeHtmlValid( parameter.getDeprecated() ) );
w.endElement(); // div
}
w.startElement( "div" );
if ( StringUtils.isNotEmpty( parameter.getDescription() ) ) if ( StringUtils.isNotEmpty( parameter.getDescription() ) )
{ {
w.writeMarkup( PluginUtils.makeHtmlValid( parameter.getDescription() ) ); w.writeMarkup( PluginUtils.makeHtmlValid( parameter.getDescription() ) );
} }
else else
{ {
w.startElement( "p" );
w.writeMarkup( getBundle( locale ).getString( "pluginxdoc.nodescription" ) ); w.writeMarkup( getBundle( locale ).getString( "pluginxdoc.nodescription" ) );
w.endElement(); // p
} }
w.endElement(); // div
w.startElement( "ul" ); w.startElement( "ul" );
writeDetail( getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.deprecated" ), parameter.getDeprecated(), w );
writeDetail( getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.type" ), parameter.getType(), w ); writeDetail( getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.type" ), parameter.getType(), w );
if ( StringUtils.isNotEmpty( parameter.getSince() ) ) if ( StringUtils.isNotEmpty( parameter.getSince() ) )
@ -508,18 +519,20 @@ public class PluginXdocGenerator
} }
w.endElement();//td w.endElement();//td
w.startElement( "td" ); w.startElement( "td" );
String description = parameter.getDescription(); String description;
if ( StringUtils.isEmpty( description ) ) if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
{ {
description = getBundle( locale ).getString( "pluginxdoc.nodescription" ); description =
"<strong>" + getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.deprecated" )
+ ".</strong> " + PluginUtils.makeHtmlValid( parameter.getDeprecated() );
}
else if ( StringUtils.isNotEmpty( parameter.getDescription() ) )
{
description = PluginUtils.makeHtmlValid( parameter.getDescription() );
} }
else else
{ {
description = PluginUtils.makeHtmlValid( description ); description = getBundle( locale ).getString( "pluginxdoc.nodescription" );
}
if ( StringUtils.isNotEmpty( parameter.getDeprecated() ) )
{
description = "<strong>" + getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.deprecated" ) + "</strong>. " + description;
} }
w.writeMarkup( description + " " ); w.writeMarkup( description + " " );