incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1431675 - in /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core: report/ParameterType.java report/XMLEasyAntReportWriter.java services/impl/DefaultPluginServiceImpl.java
Date Thu, 10 Jan 2013 21:46:04 GMT
Author: jlboudart
Date: Thu Jan 10 21:46:03 2013
New Revision: 1431675

URL: http://svn.apache.org/viewvc?rev=1431675&view=rev
Log:
Add support for fileset parameters

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
    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/report/ParameterType.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java?rev=1431675&r1=1431674&r2=1431675&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/ParameterType.java
Thu Jan 10 21:46:03 2013
@@ -18,7 +18,8 @@
 package org.apache.easyant.core.report;
 
 public enum ParameterType {
-    
-    PROPERTY,
-    PATH
+
+    PROPERTY, //
+    PATH, //
+    FILESET
 }

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java?rev=1431675&r1=1431674&r2=1431675&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/report/XMLEasyAntReportWriter.java
Thu Jan 10 21:46:03 2013
@@ -383,8 +383,13 @@ public class XMLEasyAntReportWriter {
         for (ParameterReport paramReport : easyAntReport.getParameterReports()) {
             StringBuffer param = new StringBuffer();
 
-            if (ParameterType.PATH.equals(paramReport.getType())) {
-                param.append("\t\t\t<path name=\"");
+            if (!ParameterType.PROPERTY.equals(paramReport.getType())) {
+                if (ParameterType.PATH.equals(paramReport.getType())) {
+                    param.append("\t\t\t<path name=\"");
+                }
+                if (ParameterType.FILESET.equals(paramReport.getType())) {
+                    param.append("\t\t\t<fileset name=\"");
+                }
                 param.append(paramReport.getName());
                 param.append("\"");
                 if (paramReport.getDescription() != null) {

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=1431675&r1=1431674&r2=1431675&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:46:03 2013
@@ -72,6 +72,7 @@ import org.apache.tools.ant.Target;
 import org.apache.tools.ant.Task;
 import org.apache.tools.ant.UnknownElement;
 import org.apache.tools.ant.taskdefs.Property;
+import org.apache.tools.ant.types.FileSet;
 import org.apache.tools.ant.types.Path;
 
 public class DefaultPluginServiceImpl implements PluginService {
@@ -245,6 +246,11 @@ public class DefaultPluginServiceImpl im
                     PathTask pathTask = (PathTask) maybeConfigureTask(task);
                     handlePathParameter(pathTask, eaReport);
                 }
+                if (FileSet.class.isAssignableFrom(taskClass)) {
+                    FileSet fileSet = (FileSet) maybeConfigureTask(task);
+                    handleFilesetParameter(task.getRuntimeConfigurableWrapper().getId(),
fileSet,
+                            task.getOwningTarget(), eaReport);
+                }
             }
         }
     }
@@ -340,6 +346,19 @@ public class DefaultPluginServiceImpl im
         }
     }
 
+    private void handleFilesetParameter(String id, FileSet fileSet, Target target, EasyAntReport
eaReport) {
+        ParameterReport parameterReport = new ParameterReport(ParameterType.FILESET);
+        if (id != null) {
+            parameterReport.setName(id);
+            parameterReport.setRequired(false);
+            parameterReport.setDescription(fileSet.getDescription());
+            parameterReport.setOwningTarget(target.getName());
+            eaReport.addParameterReport(parameterReport);
+            Message.debug("Ant file has a fileset called : " + parameterReport.getName());
+        }
+
+    }
+
     private void handlePathParameter(String pathid, Path path, EasyAntReport eaReport) {
         ParameterReport parameterReport = new ParameterReport(ParameterType.PATH);
         if (pathid != null) {



Mime
View raw message