incubator-easyant-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1387397 - /incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
Date Tue, 18 Sep 2012 22:20:17 GMT
Author: jlboudart
Date: Tue Sep 18 22:20:17 2012
New Revision: 1387397

URL: http://svn.apache.org/viewvc?rev=1387397&view=rev
Log:
Format EasyAntMDParser and wire plugin dependency's nested elements handling

Modified:
    incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java

Modified: incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java?rev=1387397&r1=1387396&r2=1387397&view=diff
==============================================================================
--- incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
(original)
+++ incubator/easyant/core/trunk/src/main/java/org/apache/easyant/core/parser/DefaultEasyAntXmlModuleDescriptorParser.java
Tue Sep 18 22:20:17 2012
@@ -41,7 +41,6 @@ import org.apache.ivy.ant.IvyConflict;
 import org.apache.ivy.ant.IvyDependency;
 import org.apache.ivy.ant.IvyDependencyArtifact;
 import org.apache.ivy.ant.IvyDependencyConf;
-import org.apache.ivy.ant.IvyDependencyConf.IvyDependencyConfMapped;
 import org.apache.ivy.ant.IvyDependencyExclude;
 import org.apache.ivy.ant.IvyDependencyInclude;
 import org.apache.ivy.ant.IvyExclude;
@@ -148,19 +147,19 @@ public class DefaultEasyAntXmlModuleDesc
             if (name.equals(easyantPrefix + ":dependency") && easyAntState == EasyAntState.PLUGIN)
{
                 pluginDependencyStarted(attributes);
             }
-            if (name.equals(easyantPrefix + ":exclude") &&easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
+            if (name.equals(easyantPrefix + ":exclude") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
                 pluginDependencyExcludeStarted(attributes);
             }
-            if (name.equals(easyantPrefix + ":include") &&easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
+            if (name.equals(easyantPrefix + ":include") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
                 pluginDependencyIncludeStarted(attributes);
             }
-            if (name.equals(easyantPrefix + ":artifact") &&easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
+            if (name.equals(easyantPrefix + ":artifact") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
                 pluginDependencyIncludeStarted(attributes);
             }
-            if (name.equals(easyantPrefix + ":conf") &&easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
+            if (name.equals(easyantPrefix + ":conf") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
                 pluginDependencyConfStarted(attributes);
             }
-            
+
             if (name.equals(easyantPrefix + ":exclude") && easyAntState == EasyAntState.PLUGIN)
{
                 pluginExcludeStarted(attributes);
             }
@@ -175,8 +174,8 @@ public class DefaultEasyAntXmlModuleDesc
             if (name.equals(easyantPrefix + ":plugin") && easyAntState == EasyAntState.PLUGIN)
{
                 endPlugin();
             }
-            
-            if  (name.equals(easyantPrefix + ":dependency") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
+
+            if (name.equals(easyantPrefix + ":dependency") && easyAntState == EasyAntState.PLUGIN_DEPENDENCY)
{
                 endPluginDependency();
             }
         }
@@ -185,13 +184,12 @@ public class DefaultEasyAntXmlModuleDesc
             currentPluginDescriptor = null;
             easyAntState = EasyAntState.NONE;
         }
-        
+
         public void endPluginDependency() {
-            currentPluginDependency =null;
+            currentPluginDependency = null;
             easyAntState = EasyAntState.PLUGIN;
-            
-        }
 
+        }
 
         @Override
         protected void ivyModuleStarted(Attributes attributes) throws SAXException {
@@ -283,6 +281,7 @@ public class DefaultEasyAntXmlModuleDesc
         }
 
         public void pluginDependencyStarted(Attributes attributes) {
+            easyAntState = EasyAntState.PLUGIN_DEPENDENCY;
             IvyDependency ivyDependency = new IvyDependency();
             ivyDependency.setOrg(getSettings().substitute(attributes.getValue("org")));
             ivyDependency.setForce(Boolean.valueOf(getSettings().substitute(attributes.getValue("force")))
@@ -301,7 +300,7 @@ public class DefaultEasyAntXmlModuleDesc
             currentPluginDescriptor.addDependency(ivyDependency);
             currentPluginDependency = ivyDependency;
         }
-        
+
         public void pluginDependencyExcludeStarted(Attributes attributes) {
             IvyDependencyExclude ivyDependencyExclude = currentPluginDependency.createExclude();
             ivyDependencyExclude.setOrg(getSettings().substitute(attributes.getValue("org")));
@@ -310,9 +309,9 @@ public class DefaultEasyAntXmlModuleDesc
             ivyDependencyExclude.setExt(getSettings().substitute(attributes.getValue("ext")));
             ivyDependencyExclude.setType(getSettings().substitute(attributes.getValue("type")));
             ivyDependencyExclude.setMatcher(getSettings().substitute(attributes.getValue("matcher")));
-            
+
         }
-        
+
         public void pluginDependencyIncludeStarted(Attributes attributes) {
             IvyDependencyInclude ivyDependencyInclude = currentPluginDependency.createInclude();
             ivyDependencyInclude.setName(getSettings().substitute(attributes.getValue("name")));
@@ -320,7 +319,7 @@ public class DefaultEasyAntXmlModuleDesc
             ivyDependencyInclude.setType(getSettings().substitute(attributes.getValue("type")));
             ivyDependencyInclude.setMatcher(getSettings().substitute(attributes.getValue("matcher")));
         }
-        
+
         public void pluginDependencyArtifactStarted(Attributes attributes) {
             IvyDependencyArtifact ivyDependencyArtifact = currentPluginDependency.createArtifact();
             ivyDependencyArtifact.setName(getSettings().substitute(attributes.getValue("name")));
@@ -328,12 +327,12 @@ public class DefaultEasyAntXmlModuleDesc
             ivyDependencyArtifact.setType(getSettings().substitute(attributes.getValue("type")));
             ivyDependencyArtifact.setUrl(getSettings().substitute(attributes.getValue("url")));
         }
-        
+
         public void pluginDependencyConfStarted(Attributes attributes) {
             IvyDependencyConf ivyDependencyConf = currentPluginDependency.createConf();
             ivyDependencyConf.setMapped(getSettings().substitute(attributes.getValue("mapped")));
         }
-        
+
         public void pluginConflictStarted(Attributes attributes) {
             IvyConflict ivyConflict = new IvyConflict();
             ivyConflict.setOrg(getSettings().substitute(attributes.getValue("org")));



Mime
View raw message