maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r417931 - in /maven/components/trunk: maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/ maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/ maven-plugin-tools/maven-plugin...
Date Thu, 29 Jun 2006 03:59:55 GMT
Author: brett
Date: Wed Jun 28 20:59:55 2006
New Revision: 417931

URL: http://svn.apache.org/viewvc?rev=417931&view=rev
Log:
[MNG-2406] add @since tag to plugin descriptor and report
Submitted by: Edwin Punzalan

Modified:
    maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java
    maven/components/trunk/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
    maven/components/trunk/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java

Modified: maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java?rev=417931&r1=417930&r2=417931&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java
(original)
+++ maven/components/trunk/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java
Wed Jun 28 20:59:55 2006
@@ -44,6 +44,8 @@
 
     private Requirement requirement;
 
+    private String since;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -171,5 +173,15 @@
     public void setImplementation( String implementation )
     {
         this.implementation = implementation;
+    }
+
+    public String getSince()
+    {
+        return since;
+    }
+
+    public void setSince( String since )
+    {
+        this.since = since;
     }
 }

Modified: maven/components/trunk/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java?rev=417931&r1=417930&r2=417931&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
(original)
+++ maven/components/trunk/maven-plugin-tools/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
Wed Jun 28 20:59:55 2006
@@ -318,6 +318,12 @@
 
         w.startElement( "th" );
 
+        w.writeText( "Since" );
+
+        w.endElement(); // th
+
+        w.startElement( "th" );
+
         w.writeText( "Description" );
 
         w.endElement(); // th
@@ -426,6 +432,28 @@
                 if ( StringUtils.isNotEmpty( parameter.getDefaultValue() ) )
                 {
                     w.writeText( parameter.getDefaultValue() );
+                }
+                else
+                {
+                    w.writeText( "-" );
+                }
+
+                w.endElement(); // code
+
+                w.endElement(); // td
+
+                // ----------------------------------------------------------------------
+                //
+                // ----------------------------------------------------------------------
+
+                w.startElement( "td" );
+
+                w.startElement( "code" );
+
+                String since = parameter.getSince();
+                if ( StringUtils.isNotEmpty( since ) )
+                {
+                    w.writeText( since );
                 }
                 else
                 {

Modified: maven/components/trunk/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java?rev=417931&r1=417930&r2=417931&view=diff
==============================================================================
--- maven/components/trunk/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
(original)
+++ maven/components/trunk/maven-plugin-tools/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
Wed Jun 28 20:59:55 2006
@@ -59,6 +59,10 @@
 
     public static final String PARAMETER_DEFAULT_VALUE = "default-value";
 
+    public static final String PARAMETER_ALIAS = "alias";
+
+    public static final String SINCE = "since";
+
     /**
      * This defines the default implementation in the case the parameter type is an interface.
      */
@@ -88,6 +92,12 @@
 
     public static final String EXECUTE = "execute";
 
+    public static final String EXECUTE_LIFECYCLE = "lifecycle";
+
+    public static final String EXECUTE_PHASE = "phase";
+
+    public static final String EXECUTE_GOAL = "goal";
+
     public static final String GOAL_DESCRIPTION = "description";
 
     public static final String GOAL_REQUIRES_DEPENDENCY_RESOLUTION = "requiresDependencyResolution";
@@ -108,6 +118,10 @@
 
     private static final String COMPONENT = "component";
 
+    private static final String COMPONENT_ROLE = "role";
+
+    private static final String COMPONENT_ROLEHINT = "roleHint";
+
     protected void validateParameter( Parameter parameter, int i )
         throws InvalidParameterException
     {
@@ -214,8 +228,8 @@
 
         if ( execute != null )
         {
-            String executePhase = execute.getNamedParameter( "phase" );
-            String executeGoal = execute.getNamedParameter( "goal" );
+            String executePhase = execute.getNamedParameter( EXECUTE_PHASE );
+            String executeGoal = execute.getNamedParameter( EXECUTE_GOAL );
 
             if ( executePhase == null && executeGoal == null )
             {
@@ -229,7 +243,7 @@
             mojoDescriptor.setExecutePhase( executePhase );
             mojoDescriptor.setExecuteGoal( executeGoal );
 
-            String lifecycle = execute.getNamedParameter( "lifecycle" );
+            String lifecycle = execute.getNamedParameter( EXECUTE_LIFECYCLE );
 
             if ( lifecycle != null )
             {
@@ -363,14 +377,14 @@
 
             if ( componentTag != null )
             {
-                String role = componentTag.getNamedParameter( "role" );
+                String role = componentTag.getNamedParameter( COMPONENT_ROLE );
 
                 if ( role == null )
                 {
                     role = field.getType().toString();
                 }
 
-                String roleHint = componentTag.getNamedParameter( "roleHint" );
+                String roleHint = componentTag.getNamedParameter( COMPONENT_ROLEHINT );
 
                 pd.setRequirement( new Requirement( role, roleHint ) );
 
@@ -412,7 +426,13 @@
                     pd.setDeprecated( deprecationTag.getValue() );
                 }
 
-                String alias = parameter.getNamedParameter( "alias" );
+                DocletTag sinceTag = field.getTagByName( SINCE );
+                if ( sinceTag != null )
+                {
+                    pd.setSince( sinceTag.getValue() );
+                }
+
+                String alias = parameter.getNamedParameter( PARAMETER_ALIAS );
 
                 if ( !StringUtils.isEmpty( alias ) )
                 {
@@ -429,7 +449,6 @@
                 pd.setDefaultValue( parameter.getNamedParameter( PARAMETER_DEFAULT_VALUE
) );
 
                 pd.setImplementation( parameter.getNamedParameter( PARAMETER_IMPLEMENTATION
) );
-                
             }
 
             mojoDescriptor.addParameter( pd );



Mime
View raw message