ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r783755 - in /ant/ivy/core/trunk: ./ doc/ivyfile/ src/java/org/apache/ivy/core/module/descriptor/ src/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/core/resolve/ test/repositories/1/org2/mod2.1/ivys/ test/repositories/1/org2/mo...
Date Thu, 11 Jun 2009 13:12:33 GMT
Author: xavier
Date: Thu Jun 11 13:12:32 2009
New Revision: 783755

URL: http://svn.apache.org/viewvc?rev=783755&view=rev
Log:
NEW: configuration intersections (IVY-1093)

Added:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java
  (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21A-0.5.jar   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21AB-0.5.jar   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21B-0.5.jar   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-1-0.9.jar   (with props)
    ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-2-0.9.jar   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.4.jar   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.dll   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.jar   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.so   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml   (with props)
    ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml   (with props)
Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/doc/ivyfile/dependency.html
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Jun 11 13:12:32 2009
@@ -87,6 +87,8 @@
 	
    trunk
 =====================================
+- NEW: configuration intersections (IVY-1093)
+
 - IMPROVEMENT: Pre and post retrieve artifact events (IVY-1084)
 
 - FIX: Ivy buildnumber task does not find artifact in Sonatype Nexus repo (IVY-1069)

Modified: ant/ivy/core/trunk/doc/ivyfile/dependency.html
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/ivyfile/dependency.html?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/doc/ivyfile/dependency.html (original)
+++ ant/ivy/core/trunk/doc/ivyfile/dependency.html Thu Jun 11 13:12:32 2009
@@ -110,6 +110,12 @@
 The syntax for specifying this adds the fallback conf between parenthesis right after the
required conf. 
 For instance, <code>test->runtime(default)</code> means that in the test configuration
of the module the <code>runtime</code> conf of the dependency is required, but
if doesn't exist, it will use the <code>default</code> conf instead. If <code>default</code>
conf doesn't exist then it will be considered as an error. Note that the <code>*</code>
wildcard can be used as fallback conf.
 
+<span class="since">since 2.1</span> It is also possible to define dependencies
on configurations intersection. A configuration intersection is defined using a '+' sign to
separate the configuration (eg 'A+B' means the intersection of configuration 'A' and 'B').
In that case only artifacts and dependencies defined in both configurations in the dependency
will be part of the master configuration defining the dependency on the configuration intersection.
+
+Configuration intersections can also be used when specifying the confs to [[ant:resolve]].

+
+Moreover, the mapping '*->@' is handled as a specific case with configuration intersections:
it maps also the intersections. So if one resolve conf A+B in a module which defines a dependency
with mapping *->@, the mapping *->@ is interpreted as A+B->A+B so the intersection
of A and B will be resolved in the dependency.
+
 <span class="since">since 1.4</span> you can add simple conditions in the dependency
mapping. This is done by adding a condition between '[' and ']'. If the condition evaluates
to <code>true</code>, the mapping is performed. If the condition evaluates to
<code>false</code>, the mapping will be ignored. For instance, <code>test->[org=A]runtime,[org=B]default</code>
means that the <code>test</code> configuration will be mapped to the <code>runtime</code>
conf for the dependencies of organisation 'A' and to the <code>default</code>
conf for dependencies of organisation 'B'.
 
 <li>Specify a semi-column separated list of any of the previous specs.</li> In
this case, it is the union of the mapping which is kept. For instance, 'A -> B; * ->
C' means that B conf is needed in A conf and C conf is need in all master conf... so both
B & C dep conf are required in A master conf

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/Configuration.java Thu
Jun 11 13:12:32 2009
@@ -17,6 +17,10 @@
  */
 package org.apache.ivy.core.module.descriptor;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
@@ -51,6 +55,17 @@
             return name;
         }
     }
+    
+    public static Collection/*<Configuration>*/ findConfigurationExtending(String conf,
Configuration[] confs) {
+        Collection extendingConfs = new ArrayList();
+        for (int i = 0; i < confs.length; i++) {
+            if (confs[i] != null && Arrays.asList(confs[i].getExtends()).contains(conf))
{
+                extendingConfs.add(confs[i]);
+                extendingConfs.addAll(findConfigurationExtending(confs[i].getName(), confs));
+            }
+        }
+        return extendingConfs;
+    }
 
     private String name;
 

Added: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java?rev=783755&view=auto
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java
(added)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java
Thu Jun 11 13:12:32 2009
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivy.core.module.descriptor;
+
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * A configuration which is actually the intersection of several configurations.
+ */
+public class ConfigurationIntersection extends Configuration {
+
+    private final Map/*<String, Configuration>*/ intersectedConfs;
+
+    public ConfigurationIntersection(String confName, Map /*<String, Configuration>*/
intersectedConfs) {
+        super(confName);
+        this.intersectedConfs = intersectedConfs;
+    }
+
+    /**
+     * Returns the list of configurations' names this object is an intersection of.
+     * <p>
+     * This list is built from the configuration name, if some of these configuration names
have
+     * actually not been recognized in the module, they will be <code>null</code>
when accessed from
+     * {@link #getIntersectedConfiguration(String)}.
+     * </p>
+     * 
+     * @return the list of configurations' names this object is an intersection of.
+     */
+    public String[] getIntersectedConfigurationNames() {
+        return (String[]) intersectedConfs.keySet()
+                    .toArray(new String[intersectedConfs.size()]);
+    }
+
+    /**
+     * Returns the intersected {@link Configuration} object for the given conf name, or
+     * <code>null</code> if the given conf name is not part of this intersection
or if this conf
+     * name isn't defined in the module in which this intersection has been built.
+     * 
+     * @param confName
+     *            the name of the configuration to return.
+     * @return the intersected {@link Configuration} object for the given conf name
+     */
+    public Configuration getIntersectedConfiguration(String confName) {
+        return (Configuration) intersectedConfs.get(confName);
+    }
+    
+    public Visibility getVisibility() {
+        for (Iterator it = intersectedConfs.values().iterator(); it.hasNext();) {
+            Configuration c = (Configuration) it.next();
+            if (c != null && Visibility.PRIVATE.equals(c.getVisibility())) {
+                return Visibility.PRIVATE;
+            }
+        }
+        return Visibility.PUBLIC;
+    }
+}

Propchange: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationIntersection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultDependencyDescriptor.java
Thu Jun 11 13:12:32 2009
@@ -21,6 +21,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -244,6 +245,32 @@
      */
     public String[] getDependencyConfigurations(String moduleConfiguration,
             String requestedConfiguration) {
+        if (md != null) {
+            Configuration c = md.getConfiguration(moduleConfiguration);
+            if (c instanceof ConfigurationIntersection) {
+                ConfigurationIntersection intersection = (ConfigurationIntersection) c;
+                Set /*<String>*/ intersectedDepConfs = new HashSet();
+                String[] intersected = intersection.getIntersectedConfigurationNames();
+                for (int i = 0; i < intersected.length; i++) {
+                    Collection depConfs = 
+                         getDependencyConfigurationsIncludingExtending(
+                                 intersected[i], requestedConfiguration);
+                    if (intersectedDepConfs.isEmpty()) {
+                        intersectedDepConfs.addAll(depConfs);
+                    } else {
+                        intersectedDepConfs.retainAll(depConfs);
+                    }
+                }
+                if (intersectedDepConfs.isEmpty()) {
+                    List defConfs = (List) confs.get("*");
+                    if (defConfs != null && defConfs.contains("@")) {
+                        return new String[] {moduleConfiguration};
+                    }
+                }
+                return (String[]) intersectedDepConfs.toArray(new String[intersectedDepConfs.size()]);
+            }
+        }
+        
         List confsList = (List) confs.get(moduleConfiguration);
         if (confsList == null) {
             // there is no mapping defined for this configuration, add the 'other' mappings.
@@ -285,6 +312,20 @@
         return (String[]) ret.toArray(new String[ret.size()]);
     }
 
+    private Collection getDependencyConfigurationsIncludingExtending(
+            String conf, String requestedConfiguration) {
+        Set/*<String>*/ allDepConfs = new LinkedHashSet();
+        allDepConfs.addAll(Arrays.asList(getDependencyConfigurations(conf, requestedConfiguration)));
+
+        Collection extendingConfs = Configuration.findConfigurationExtending(conf, md.getConfigurations());
+        for (Iterator it = extendingConfs.iterator(); it.hasNext();) {
+            Configuration extendingConf = (Configuration) it.next();
+            allDepConfs.addAll(Arrays.asList(getDependencyConfigurations(
+                            extendingConf.getName(), requestedConfiguration)));
+        }
+        return allDepConfs;
+    }
+
     protected static String replaceSelfFallbackPattern(final String conf,
             final String moduleConfiguration) {
         return replaceFallbackConfigurationPattern(

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=783755&r1=783754&r2=783755&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
Thu Jun 11 13:12:32 2009
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -388,18 +389,71 @@
      * if not found.
      */
     public Configuration getConfiguration(String confName) {
-        return (Configuration) configurations.get(confName);
+        Configuration configuration = (Configuration) configurations.get(confName);
+        if (configuration == null && confName != null) {
+            // let's see if a configuration intersection is requested
+            String[] confs = confName.split("\\+");
+            if (confs.length <= 1) {
+                return null;
+            }
+            Map /*<String,Configuration>*/ intersectedConfs = new LinkedHashMap();
+            for (int i = 0; i < confs.length; i++) {
+                Configuration c = (Configuration) configurations.get(confs[i]);
+                if (c == null) {
+                    Message.verbose(
+                        "missing configuration '" + confs[i] 
+                        + "' from intersection " + confName + " in " + this);
+                    return null;
+                }
+                intersectedConfs.put(confs[i], c);
+            }
+            return new ConfigurationIntersection(confName, intersectedConfs);
+        }
+        return configuration;
     }
 
     public Artifact[] getArtifacts(String conf) {
         Collection artifacts = (Collection) artifactsByConf.get(conf);
         if (artifacts == null) {
-            return new Artifact[0];
+            Configuration c = getConfiguration(conf);
+            if (c instanceof ConfigurationIntersection) {
+                ConfigurationIntersection intersection = (ConfigurationIntersection) c;
+                String[] intersected = intersection.getIntersectedConfigurationNames();
+                Set/*<Artifact>*/ intersectedArtifacts = new LinkedHashSet();
+                for (int j = 0; j < intersected.length; j++) {
+                    Collection arts = getArtifactsIncludingExtending(intersected[j]);
+                    if (intersectedArtifacts.isEmpty()) {
+                        intersectedArtifacts.addAll(arts);
+                    } else {
+                        intersectedArtifacts.retainAll(arts);
+                    }
+                }
+                return (Artifact[]) intersectedArtifacts.toArray(new Artifact[intersectedArtifacts.size()]);
+            } else {
+                return new Artifact[0];
+            }
         } else {
             return (Artifact[]) artifacts.toArray(new Artifact[artifacts.size()]);
         }
     }
 
+    private Collection/*<Artifact>*/ getArtifactsIncludingExtending(String conf) {
+        Collection extendingConfs = Configuration.findConfigurationExtending(conf, getConfigurations());
+        Set/*<Artifact>*/ artifacts = new LinkedHashSet();
+        Collection arts = (Collection) artifactsByConf.get(conf);
+        if (arts != null) {
+            artifacts.addAll(arts);
+        }
+        for (Iterator it = extendingConfs.iterator(); it.hasNext();) {
+            Configuration extendingConf = (Configuration) it.next();
+            arts = (Collection) artifactsByConf.get(extendingConf.getName());
+            if (arts != null) {
+                artifacts.addAll(arts);
+            }
+        }
+        return artifacts;
+    }
+
     public Artifact[] getAllArtifacts() {
         return (Artifact[]) artifacts.toArray(new Artifact[artifacts.size()]);
     }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Thu Jun 11 13:12:32
2009
@@ -39,6 +39,7 @@
 import org.apache.ivy.core.event.resolve.StartResolveDependencyEvent;
 import org.apache.ivy.core.module.descriptor.Artifact;
 import org.apache.ivy.core.module.descriptor.Configuration;
+import org.apache.ivy.core.module.descriptor.ConfigurationIntersection;
 import org.apache.ivy.core.module.descriptor.DefaultArtifact;
 import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor;
 import org.apache.ivy.core.module.descriptor.DependencyDescriptor;

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=783755&r1=783754&r2=783755&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Thu Jun 11 13:12:32
2009
@@ -3642,6 +3642,80 @@
         assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.1", "art51B", "jar", "jar").exists());
     }
 
+    public void testResolveIntersectConfiguration1() throws Exception {
+        // mod5.2;3.0 -> mod5.1;4.4 (*->@)
+        // mod5.1;4.4 -> mod1.2;2.0 (B,xplatform->default)
+        // mod5.1;4.4 -> mod2.2;0.9 (B,windows->myconf1;B,linux->myconf2)
+        // mod5.1;4.4 -> mod2.1;0.5 (B,windows->A+B)
+        ivy.resolve(new File("test/repositories/2/mod5.2/ivy-3.0.xml").toURL(),
+            getResolveOptions(new String[] {"A"}));
+
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51A", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "dll", "dll").exists());
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "so", "so").exists());
+    }
+
+    public void testResolveIntersectConfiguration2() throws Exception {
+        // mod5.2;3.0 -> mod5.1;4.4 (*->@)
+        // mod5.1;4.4 -> mod1.2;2.0 (B,xplatform->default)
+        // mod5.1;4.4 -> mod2.2;0.9 (B,windows->myconf1;B,linux->myconf2)
+        // mod5.1;4.4 -> mod2.1;0.5 (B,windows->A+B)
+        ivy.resolve(new File("test/repositories/2/mod5.2/ivy-3.0.xml").toURL(),
+            getResolveOptions(new String[] {"B"}));
+
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51A", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "dll", "dll").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "so", "so").exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-1", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-2", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21A", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21B", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21AB", "jar", "jar").exists());
+    }
+
+    public void testResolveIntersectConfiguration3() throws Exception {
+        // mod5.2;3.0 -> mod5.1;4.4 (*->@)
+        // mod5.1;4.4 -> mod1.2;2.0 (B,xplatform->default)
+        // mod5.1;4.4 -> mod2.2;0.9 (B,windows->myconf1;B,linux->myconf2)
+        // mod5.1;4.4 -> mod2.1;0.5 (B,windows->A+B)
+        ivy.resolve(new File("test/repositories/2/mod5.2/ivy-3.0.xml").toURL(),
+            getResolveOptions(new String[] {"B+windows"}));
+
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51A", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "dll", "dll").exists());
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "so", "so").exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-1", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-2", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21A", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21B", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21AB", "jar", "jar").exists());
+    }
+
+    public void testResolveIntersectConfiguration4() throws Exception {
+        // mod5.2;3.0 -> mod5.1;4.4 (*->@)
+        // mod5.1;4.4 -> mod1.2;2.0 (B,xplatform->default)
+        // mod5.1;4.4 -> mod2.2;0.9 (B,windows->myconf1;B,linux->myconf2)
+        // mod5.1;4.4 -> mod2.1;0.5 (B,windows->A+B)
+        ivy.resolve(new File("test/repositories/2/mod5.2/ivy-3.0.xml").toURL(),
+            getResolveOptions(new String[] {"B+linux"}));
+
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51A", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "dll", "dll").exists());
+        assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.4", "art51B", "so", "so").exists());
+        assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-1", "jar", "jar").exists());
+        assertTrue(getArchiveFileInCache("org2", "mod2.2", "0.9", "art22-2", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21A", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21B", "jar", "jar").exists());
+        assertFalse(getArchiveFileInCache("org2", "mod2.1", "0.5", "art21AB", "jar", "jar").exists());
+    }
+
     public void testResolveFallbackConfiguration() throws Exception {
         // mod10.2 depends on mod5.1 conf runtime(default)
         ivy.resolve(new File("test/repositories/2/mod10.2/ivy-1.0.xml").toURL(),

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml?rev=783755&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml (added)
+++ ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml Thu Jun 11 13:12:32
2009
@@ -0,0 +1,35 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+	<info organisation="org2"
+	       module="mod2.1"
+	       revision="0.5"
+	       status="integration"
+	       publication="20090301110000"
+	/>
+	<configurations>
+		<conf name="A"/>
+		<conf name="B"/>
+	</configurations>
+	<publications>
+		<artifact name="art21A" type="jar" conf="A"/>
+		<artifact name="art21B" type="jar" conf="B"/>
+		<artifact name="art21AB" type="jar" conf="A,B"/>
+	</publications>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.5.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21A-0.5.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21A-0.5.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21A-0.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21AB-0.5.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21AB-0.5.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21AB-0.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21B-0.5.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21B-0.5.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/jars/art21B-0.5.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml?rev=783755&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml (added)
+++ ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml Thu Jun 11 13:12:32
2009
@@ -0,0 +1,34 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+	<info organisation="org2"
+	       module="mod2.2"
+	       revision="0.9"
+	       status="integration"
+	       publication="20091101110000"
+	/>
+	<configurations>
+		<conf name="myconf1" description="desc 1" />
+		<conf name="myconf2" description="desc 2" />
+	</configurations>
+	<publications>
+		<artifact name="art22-1" conf="myconf1" />
+		<artifact name="art22-2" conf="myconf2" />
+	</publications>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/ivys/ivy-0.9.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-1-0.9.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-1-0.9.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-1-0.9.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-2-0.9.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-2-0.9.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.2/jars/art22-2-0.9.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.4.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.4.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.dll
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.dll?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.dll
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.jar?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.so
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.so?rev=783755&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.4.so
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml?rev=783755&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml (added)
+++ ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml Thu Jun 11 13:12:32 2009
@@ -0,0 +1,45 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+	<info organisation="org5"
+	       module="mod5.1"
+	       revision="4.4"
+	       status="integration"
+	       publication="20090401110000"
+	/>
+	<configurations>
+		<conf name="A"/>
+		<conf name="B"/>
+		
+		<conf name="windows"/>
+		<conf name="linux"/>
+		<conf name="xplatform" extends="windows,linux"/>
+	</configurations>
+	<publications>
+		<artifact name="art51A" type="jar" conf="A,xplatform"/>
+		<artifact name="art51B" type="jar" conf="B,xplatform"/>
+		<artifact name="art51B" type="dll" conf="B,windows"/>
+		<artifact name="art51B" type="so" conf="B,linux"/>
+	</publications>
+	<dependencies>
+		<dependency org="org1" name="mod1.2" rev="2.0" conf="B,xplatform->default"/>
+		<dependency org="org2" name="mod2.2" rev="0.9" conf="B,windows->myconf1;B,linux->myconf2"/>
+		<dependency org="org2" name="mod2.1" rev="0.5" conf="B,windows->A+B"/>
+	</dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.4.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml?rev=783755&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml (added)
+++ ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml Thu Jun 11 13:12:32 2009
@@ -0,0 +1,38 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+	<info organisation="org5"
+	       module="mod5.2"
+	       revision="3.0"
+	       status="integration"
+	       publication="20090301110000"
+	/>
+	<configurations>
+		<conf name="A"/>
+		<conf name="B"/>
+		
+		<conf name="windows"/>
+		<conf name="linux"/>
+		<conf name="xplatform" extends="windows,linux"/>
+	</configurations>
+	<publications />
+	<dependencies>
+		<dependency name="mod5.1" rev="4.4" conf="*->@"/>
+	</dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.0.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message