ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r1297407 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/core/module/descriptor/ src/java/org/apache/ivy/plugins/parser/ src/java/org/apache/ivy/plugins/parser/xml/
Date Tue, 06 Mar 2012 10:25:59 GMT
Author: maartenc
Date: Tue Mar  6 10:25:59 2012
New Revision: 1297407

URL: http://svn.apache.org/viewvc?rev=1297407&view=rev
Log:
FIX: extends ignores defaultconfmapping/defaultconf/confmappingoverride attributes from parent's
configurations and dependencies tags (IVY-1213)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1297407&r1=1297406&r2=1297407&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Tue Mar  6 10:25:59 2012
@@ -139,6 +139,7 @@ for detailed view of each issue, please 
 - IMPROVEMENT: ivy:retrieve can now convert 'dotted'-organisation names into a directory
tree.
 - IMPROVEMENT: ivy:retrieve now accepts a nested mapper type.
 
+- FIX: extends ignores defaultconfmapping/defaultconf/confmappingoverride attributes from
parent's configurations and dependencies tags (IVY-1213)
 - FIX: NullPointerException when providing empty password to <credentials> (IVY-1335)
 - FIX: [originalname] not expanded for source and javadoc types during publish in ivy:install
(IVY-1324)
 - FIX: cannot resolve from repositories that return HTTP 204 in response to an HTTP HEAD
request (IVY-1328)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java?rev=1297407&r1=1297406&r2=1297407&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
Tue Mar  6 10:25:59 2012
@@ -230,6 +230,10 @@ public class DefaultModuleDescriptor imp
 
     private Namespace namespace;
 
+    private String defaultConf;
+
+    private String defaultConfMapping;
+
     private boolean mappingOverride;
 
     private ModuleDescriptorParser parser;
@@ -717,6 +721,22 @@ public class DefaultModuleDescriptor imp
         }
     }
 
+    public String getDefaultConf() {
+        return defaultConf;
+    }
+
+    public void setDefaultConf(String defaultConf) {
+        this.defaultConf = defaultConf;
+    }
+
+    public String getDefaultConfMapping() {
+        return defaultConfMapping;
+    }
+
+    public void setDefaultConfMapping(String defaultConfMapping) {
+        this.defaultConfMapping = defaultConfMapping;
+    }
+
     public void setMappingOverride(boolean override) {
         mappingOverride = override;
     }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java?rev=1297407&r1=1297406&r2=1297407&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/AbstractModuleDescriptorParser.java
Tue Mar  6 10:25:59 2012
@@ -106,6 +106,7 @@ public abstract class AbstractModuleDesc
 
         protected void setDefaultConfMapping(String defaultConf) {
             defaultConfMapping = defaultConf;
+            getMd().setDefaultConfMapping(defaultConf);
         }
 
         protected void parseDepsConfs(String confs, DefaultDependencyDescriptor dd) {
@@ -336,6 +337,7 @@ public abstract class AbstractModuleDesc
 
         protected void setDefaultConf(String defaultConf) {
             this.defaultConf = defaultConf;
+            getMd().setDefaultConf(defaultConf);
         }
 
         public ModuleDescriptor getModuleDescriptor() throws ParseException {

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java?rev=1297407&r1=1297406&r2=1297407&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorParser.java
Tue Mar  6 10:25:59 2012
@@ -468,7 +468,7 @@ public class XmlModuleDescriptorParser e
          * @param parent a given parent module descriptor
          */
         protected void mergeWithOtherModuleDescriptor(List/* <String> */extendTypes,
-                ModuleDescriptor parent) {
+                ModuleDescriptor parent) throws ParseException {
 
             if (extendTypes.contains("all")) {
                 mergeAll(parent);
@@ -478,7 +478,7 @@ public class XmlModuleDescriptorParser e
                 }
                 
                 if (extendTypes.contains("configurations")) {
-                    mergeConfigurations(parent.getModuleRevisionId(), parent.getConfigurations());
+                    mergeConfigurations(parent);
                 }
 
                 if (extendTypes.contains("dependencies")) {
@@ -500,9 +500,8 @@ public class XmlModuleDescriptorParser e
          * @param parent a given parent module desciptor
          */
         protected void mergeAll(ModuleDescriptor parent) {
-            ModuleRevisionId sourceMrid = parent.getModuleRevisionId();
             mergeInfo(parent);
-            mergeConfigurations(sourceMrid, parent.getConfigurations());
+            mergeConfigurations(parent);
             mergeDependencies(parent.getDependencies());
             mergeDescription(parent.getDescription());
             mergeLicenses(parent.getLicenses());
@@ -561,13 +560,20 @@ public class XmlModuleDescriptorParser e
          * @param sourceMrid the source module revision id
          * @param configurations array of configurations to be inherited 
          */
-        protected void mergeConfigurations(ModuleRevisionId sourceMrid, Configuration[] configurations)
{
-            DefaultModuleDescriptor md = getMd();
+        protected void mergeConfigurations(ModuleDescriptor parent) {
+            ModuleRevisionId sourceMrid = parent.getModuleRevisionId();
+            Configuration[] configurations = parent.getConfigurations();
             for (int i = 0; i < configurations.length; i++) {
                 Configuration configuration = configurations[i];
                 Message.debug("Merging configuration with: " + configuration.getName());
                 //copy configuration from parent descriptor
-                md.addConfiguration(new Configuration(configuration, sourceMrid));
+                getMd().addConfiguration(new Configuration(configuration, sourceMrid));
+            }
+
+            if (parent instanceof DefaultModuleDescriptor) {
+                setDefaultConfMapping(((DefaultModuleDescriptor) parent).getDefaultConfMapping());
+                setDefaultConf(((DefaultModuleDescriptor) parent).getDefaultConf());
+                getMd().setMappingOverride(((DefaultModuleDescriptor) parent).isMappingOverride());
             }
         }
 



Mime
View raw message