incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1431670 - /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java
Date Thu, 10 Jan 2013 21:43:57 GMT
Author: jlboudart
Date: Thu Jan 10 21:43:57 2013
New Revision: 1431670

URL: http://svn.apache.org/viewvc?rev=1431670&view=rev
Log:
Add handling support for ant Path type and easyant:path task
pathid and description in those task can now document the plugin :)

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java?rev=1431670&r1=1431669&r2=1431670&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/services/impl/DefaultPluginServiceImpl.java
Thu Jan 10 21:43:57 2013
@@ -46,6 +46,7 @@ import org.apache.easyant.tasks.Import;
 import org.apache.easyant.tasks.ImportTestModule;
 import org.apache.easyant.tasks.LoadModule;
 import org.apache.easyant.tasks.ParameterTask;
+import org.apache.easyant.tasks.PathTask;
 import org.apache.ivy.Ivy;
 import org.apache.ivy.ant.IvyAntSettings;
 import org.apache.ivy.core.IvyContext;
@@ -236,6 +237,14 @@ public class DefaultPluginServiceImpl im
                     Import importTask = (Import) maybeConfigureTask(task);
                     handleImport(importTask, eaReport, conf);
                 }
+                if (Path.class.isAssignableFrom(taskClass)) {
+                    Path path = (Path) maybeConfigureTask(task);
+                    handlePathParameter(task.getRuntimeConfigurableWrapper().getId(), path,
eaReport);
+                }
+                if (PathTask.class.isAssignableFrom(taskClass)) {
+                    PathTask pathTask = (PathTask) maybeConfigureTask(task);
+                    handlePathParameter(pathTask, eaReport);
+                }
             }
         }
     }
@@ -331,6 +340,31 @@ public class DefaultPluginServiceImpl im
         }
     }
 
+    private void handlePathParameter(String pathid, Path path, EasyAntReport eaReport) {
+        ParameterReport parameterReport = new ParameterReport(ParameterType.PATH);
+        if (pathid != null) {
+            parameterReport.setName(pathid);
+            parameterReport.setRequired(false);
+            parameterReport.setDescription(path.getDescription());
+            eaReport.addParameterReport(parameterReport);
+            Message.debug("Ant file has a path called : " + parameterReport.getName());
+        }
+    }
+
+    private void handlePathParameter(PathTask pathTask, EasyAntReport eaReport) {
+        ParameterReport parameterReport = new ParameterReport(ParameterType.PATH);
+        if (pathTask.getPathid() != null && pathTask.getDescription() != null) {
+            parameterReport.setName(pathTask.getPathid());
+            parameterReport.setRequired(false);
+            parameterReport.setDescription(pathTask.getDescription());
+            if (pathTask.getOwningTarget() != null) {
+                parameterReport.setOwningTarget(pathTask.getOwningTarget().getName());
+            }
+            eaReport.addParameterReport(parameterReport);
+            Message.debug("Ant file has a path called : " + parameterReport.getName());
+        }
+    }
+
     private void handleTarget(Target target, EasyAntReport eaReport) {
         if (!"".equals(target.getName())) {
             boolean isExtensionPoint = target instanceof ExtensionPoint;



Mime
View raw message