Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 5208 invoked from network); 6 Jul 2009 11:20:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Jul 2009 11:20:08 -0000 Received: (qmail 52460 invoked by uid 500); 6 Jul 2009 11:20:18 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 52353 invoked by uid 500); 6 Jul 2009 11:20:18 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 52343 invoked by uid 99); 6 Jul 2009 11:20:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2009 11:20:18 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gscokart@gmail.com designates 209.85.218.221 as permitted sender) Received: from [209.85.218.221] (HELO mail-bw0-f221.google.com) (209.85.218.221) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2009 11:20:04 +0000 Received: by bwz21 with SMTP id 21so1007208bwz.28 for ; Mon, 06 Jul 2009 04:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ioPUaU0aTg/6dnHJeem/w2+qeD/tLhLZI+Wf8swd1yE=; b=pDYPOxTJFIGhom+eS+w1bJONCeKbgpbXSxfFDzv+qiaYSHcRYX0AYHWhfOujrBVdwl vRQ5EWZazWZ29L//tZmy+5urT0tR+zobQR2/50DJsVLMnKgpAripL6fV1BGJVFRF/vHA PzKNNsZVpGAYuvnwP/Npmg6q+IJS2vD7+IseY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RuU68p1d8h2O5yE4s7wEJLsaoEuRWQ8YJITi9lYbfaBmZLvk6IVZp/H0ot1GoOo+4u J9m2yFkJ6qKNr+Ji5rovMG6n2r1W4TjiUeqSunY7q+ZPoT5vlI51xRSgAJvgh4rwReT7 pAP/Xit2SrhtFXTSvnzBSadg226zuDnK+7Xxo= MIME-Version: 1.0 Received: by 10.103.108.18 with SMTP id k18mr2500607mum.40.1246879183263; Mon, 06 Jul 2009 04:19:43 -0700 (PDT) In-Reply-To: <635a05060907010004pa14716aj94c239a81a7e415a@mail.gmail.com> References: <20090628130211.DFF1E23888D7@eris.apache.org> <635a05060907010004pa14716aj94c239a81a7e415a@mail.gmail.com> Date: Mon, 6 Jul 2009 13:19:43 +0200 Message-ID: Subject: Re: svn commit: r789095 - in /ant/ivy/core/trunk: ./ doc/ivyfile/ src/java/org/apache/ivy/core/module/descriptor/ test/java/org/apache/ivy/core/resolve/ test/repositories/2/mod5.1/ test/repositories/2/mod5.2/ From: Gilles Scokart To: Ant Developers List Content-Type: multipart/alternative; boundary=0016364167f1cbd998046e07ae5a X-Virus-Checked: Checked by ClamAV on apache.org --0016364167f1cbd998046e07ae5a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I preffer much more this example than the ones with colors. I guess that this make sense only inside configuration expressions using intersection. Am I right? Gilles Scokart 2009/7/1 Xavier Hanin > Here's a real world example: > > > > > > > > It's nice to be able to refer to the platform configurations, especially if > the configurations are defined in a separate file, or maybe even several > ones, so you don't know in advance all the platform configurations. > > Does it make sense for you? > > Xavier > > On Mon, Jun 29, 2009 at 8:24 PM, Gilles Scokart > wrote: > > > Do you have a concrete use case for this feature? Based on the the > > example, > > I didn't catch it directly. Maybe a real example combining 2 real axes > > (other than 'color') would help. > > > > > > Gilles Scokart > > > > > > 2009/6/28 > > > > > Author: xavier > > > Date: Sun Jun 28 13:02:10 2009 > > > New Revision: 789095 > > > > > > URL: http://svn.apache.org/viewvc?rev=789095&view=rev > > > Log: > > > NEW: configuration groups (IVY-1097) > > > > > > Added: > > > > > > > > > ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java > > > (with props) > > > ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.dll (with > > > props) > > > ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.jar (with > > > props) > > > ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.so (with > > > props) > > > ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml (with > > props) > > > ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.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/DefaultDependencyDescriptor.java > > > > > > > > > ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.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=789095&r1=789094&r2=789095&view=diff > > > > > > > > > ============================================================================== > > > --- ant/ivy/core/trunk/CHANGES.txt (original) > > > +++ ant/ivy/core/trunk/CHANGES.txt Sun Jun 28 13:02:10 2009 > > > @@ -90,6 +90,7 @@ > > > trunk > > > ===================================== > > > - NEW: configuration intersections (IVY-1093) > > > +- NEW: configuration groups (IVY-1097) > > > > > > - IMPROVEMENT: Added support for NTLM authentication (IVY-1094) > (thanks > > to > > > Mathieu Anquetin) > > > - IMPROVEMENT: Standalone runner should accept all the same parameters > > as > > > ant tasks (IVY-1090) > > > > > > Modified: ant/ivy/core/trunk/doc/ivyfile/dependency.html > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/doc/ivyfile/dependency.html?rev=789095&r1=789094&r2=789095&view=diff > > > > > > > > > ============================================================================== > > > --- ant/ivy/core/trunk/doc/ivyfile/dependency.html (original) > > > +++ ant/ivy/core/trunk/doc/ivyfile/dependency.html Sun Jun 28 13:02:10 > > 2009 > > > @@ -33,12 +33,14 @@ > > > The revision can be given as a fixed one (1.5.2, for instance) or as a > > > latest (or dynamic) one. Several possibilities for dynamic revisions > are > > > implemented in Ivy: > > >
    > > >
  • latest.integration
  • selects the latest revision of the > > dependency > > > module. > > > -
  • latest.[any status]
  • selects the latest revision of the > > dependency > > > module with at least the specified status. since > > > 1.4 > > > +
  • latest.[any status] since 1.4
  • > > selects > > > the latest revision of the dependency module with at least the > specified > > > status. > > > + > > > For instance latest.milestone will select the latest version being > > either > > > a milestone or a release, and latest.release will only selects the > latest > > > release. Note that in order to find the latest revision with the > > appropriate > > > status Ivy has to parse all the ivy files in your repository from the > > last > > > one until it finds such a revision. Hence don't be surprised if the > > > resolution slow down. > > > See also [[settings/statuses]] to see how to configure module > statuses. > > >
  • end the revision with a +
  • selects the latest sub-revision of > > the > > > dependency module. For instance, > > > if the dependency module exists in revision 1.0.3, 1.0.7 and 1.1.2, > > > "1.0.+" will select 1.0.7. > > > -
  • version ranges
  • mathematical notation for ranges can be used > to > > > match a range of version. since 1.4 > > > +
  • version ranges since 1.4
  • > > mathematical > > > notation for ranges can be used to match a range of version. > > > + > > > Examples: > > > [1.0,2.0] matches all versions greater or equal to 1.0 and lower or > > equal > > > to 2.0 > > > [1.0,2.0[ matches all versions greater or equal to 1.0 and lower than > > 2.0 > > > @@ -116,7 +118,30 @@ > > > > > > 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. > > > > > > -since 1.4 you can add simple conditions in > > the > > > dependency mapping. This is done by adding a condition between '[' and > > ']'. > > > If the condition evaluates to true, the mapping is > > performed. > > > If the condition evaluates to false, the mapping will be > > > ignored. For instance, test->[org=A]runtime,[org=B]default > > > means that the test configuration will be mapped to the > > > runtime conf for the dependencies of organisation 'A' and > to > > > the default conf for dependencies of organisation 'B'. > > > +since 2.1 you can refer to a group of > > > configurations sharing the same value for an attribute as left side > part > > of > > > the dependency mapping. > > > + > > > +The syntax is > > > +*[att=value] > > > +where att is the name of the attribute shared by the > > > configurations of the group, and value > > attribute that configurations must have to be part of the group. This > is > > > especially useful with extra attributes. > > > + > > > +For instance, if you have: > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > +Then you can do: > > > + > > > + > > conf="*[axis=platform]->default"/> > > > + > > > +To map the windows and linux configurations (the one which have the > > > attribute axis equal to platform) to the default configuration of foo. > > > + > > > +since 1.4 you can add simple conditions in > > the > > > right side of the dependency mapping. This is done by adding a > condition > > > between '[' and ']'. If the condition evaluates to true, > the > > > mapping is performed. If the condition evaluates to false, > > the > > > mapping will be ignored. For instance, > > > test->[org=A]runtime,[org=B]default means that the > > > test configuration will be mapped to the > > runtime > > > conf for the dependencies of organisation 'A' and to the > > > default conf for dependencies of organisation 'B'. > > > > > >
  • Specify a semi-column separated list of any of the previous > > > specs.
  • 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 > > >
> > > > > > Added: > > > > > > ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > --- > > > > > > ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java > > > (added) > > > +++ > > > > > > ant/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/ConfigurationGroup.java > > > Sun Jun 28 13:02:10 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 a group of several > configurations. > > > + */ > > > +public class ConfigurationGroup extends Configuration { > > > + > > > + private final Map/**/ members; > > > + > > > + public ConfigurationGroup(String confName, Map /* > > Configuration>*/ members) { > > > + super(confName); > > > + this.members = members; > > > + } > > > + > > > + /** > > > + * Returns the list of configurations' names this object is a > group > > > of. > > > + *

> > > + * 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 > > > null when accessed from > > > + * {@link #getIntersectedConfiguration(String)}. > > > + *

> > > + * > > > + * @return the list of configurations' names this object is an > > > intersection of. > > > + */ > > > + public String[] getMembersConfigurationNames() { > > > + return (String[]) members.keySet() > > > + .toArray(new String[members.size()]); > > > + } > > > + > > > + /** > > > + * Returns the {@link Configuration} object for the given conf > name, > > > or > > > + * null if the given conf name is not part of this > > group > > > or if this conf > > > + * name isn't defined in the module in which this group has been > > > built. > > > + * > > > + * @param confName > > > + * the name of the configuration to return. > > > + * @return the member {@link Configuration} object for the given > > conf > > > name > > > + */ > > > + public Configuration getMemberConfiguration(String confName) { > > > + return (Configuration) members.get(confName); > > > + } > > > + > > > + public Visibility getVisibility() { > > > + for (Iterator it = members.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/ConfigurationGroup.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=789095&r1=789094&r2=789095&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 > > > Sun Jun 28 13:02:10 2009 > > > @@ -305,20 +305,37 @@ > > > } > > > } > > > } > > > + List confsList = (List) > confs.get(moduleConfiguration); > > > + if (confsList != null) { > > > + intersectedDepConfs.addAll(confsList); > > > + } > > > if (intersectedDepConfs.isEmpty()) { > > > List defConfs = (List) confs.get("*"); > > > if (defConfs != null) { > > > for (Iterator it = defConfs.iterator(); > > > it.hasNext();) { > > > String mappedConf = (String) it.next(); > > > if (mappedConf != null && > > > mappedConf.startsWith("@+")) { > > > - return new String[] > {moduleConfiguration > > + > > > mappedConf.substring(1)}; > > > + return new String[] { > > > + moduleConfiguration + > > > mappedConf.substring(1)}; > > > } else if (mappedConf != null && > > > mappedConf.equals("@")) { > > > return new String[] > > {moduleConfiguration}; > > > } > > > } > > > } > > > } > > > - return (String[]) intersectedDepConfs.toArray(new > > > String[intersectedDepConfs.size()]); > > > + return (String[]) intersectedDepConfs.toArray( > > > + new String[intersectedDepConfs.size()]); > > > + } else if (c instanceof ConfigurationGroup) { > > > + ConfigurationGroup group = (ConfigurationGroup) c; > > > + Set /**/ groupDepConfs = new HashSet(); > > > + String[] members = > group.getMembersConfigurationNames(); > > > + for (int i = 0; i < members.length; i++) { > > > + Collection depConfs = > > > + > getDependencyConfigurationsIncludingExtending( > > > + members[i], requestedConfiguration); > > > + groupDepConfs.addAll(depConfs); > > > + } > > > + return (String[]) groupDepConfs.toArray(new > > > String[groupDepConfs.size()]); > > > } > > > } > > > > > > @@ -532,6 +549,14 @@ > > > + "' to configuration '" + masterConf + "' of > module > > " > > > + md.getModuleRevisionId() + " because this > > > configuration doesn't exist!"); > > > } > > > + if (config instanceof ConfigurationGroup) { > > > + ConfigurationGroup group = (ConfigurationGroup) > config; > > > + String[] members = > group.getMembersConfigurationNames(); > > > + for (int i = 0; i < members.length; i++) { > > > + addDependencyConfiguration(members[i], depConf); > > > + } > > > + return; > > > + } > > > } > > > > > > List confsList = (List) confs.get(masterConf); > > > > > > 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=789095&r1=789094&r2=789095&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 > > > Sun Jun 28 13:02:10 2009 > > > @@ -23,7 +23,6 @@ > > > 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; > > > @@ -33,6 +32,8 @@ > > > import java.util.Map; > > > import java.util.Set; > > > import java.util.Stack; > > > +import java.util.regex.Matcher; > > > +import java.util.regex.Pattern; > > > > > > import org.apache.ivy.core.module.id.ArtifactId; > > > import org.apache.ivy.core.module.id.ModuleId; > > > @@ -337,19 +338,27 @@ > > > * @param artifact > > > */ > > > public void addArtifact(String conf, Artifact artifact) { > > > - if (!configurations.containsKey(conf)) { > > > + Configuration c = getConfiguration(conf); > > > + if (c == null) { > > > throw new IllegalArgumentException("Cannot add artifact '" > + > > > artifact.getId().getArtifactId().getShortDescription() > > > + "' to configuration '" + conf + "' of module " + > > > revId > > > + " because this configuration doesn't exist!"); > > > } > > > - > > > - Collection artifacts = (Collection) artifactsByConf.get(conf); > > > - if (artifacts == null) { > > > - artifacts = new ArrayList(); > > > - artifactsByConf.put(conf, artifacts); > > > + if (c instanceof ConfigurationGroup) { > > > + ConfigurationGroup group = (ConfigurationGroup) c; > > > + String[] members = group.getMembersConfigurationNames(); > > > + for (int i = 0; i < members.length; i++) { > > > + addArtifact(members[i], artifact); > > > + } > > > + } else { > > > + Collection artifacts = (Collection) > > artifactsByConf.get(conf); > > > + if (artifacts == null) { > > > + artifacts = new ArrayList(); > > > + artifactsByConf.put(conf, artifacts); > > > + } > > > + artifacts.add(artifact); > > > + this.artifacts.add(artifact); > > > } > > > - artifacts.add(artifact); > > > - this.artifacts.add(artifact); > > > } > > > > > > public ModuleRevisionId getModuleRevisionId() { > > > @@ -391,6 +400,23 @@ > > > public Configuration getConfiguration(String confName) { > > > Configuration configuration = (Configuration) > > > configurations.get(confName); > > > if (configuration == null && confName != null) { > > > + // let's first check if the configuration is a conf group > > > + Matcher m = > > > Pattern.compile("\\*\\[([^=]+)\\=([^\\]]+)\\]").matcher(confName); > > > + if (m.matches()) { > > > + String attName = m.group(1); > > > + String attValue = m.group(2); > > > + > > > + // this is a conf group, let's search for its members > > > + Map /**/ members = new > > > LinkedHashMap(); > > > + for (Iterator it = configurations.values().iterator(); > > > it.hasNext();) { > > > + Configuration conf = (Configuration) it.next(); > > > + if (attValue.equals(conf.getAttribute(attName))) { > > > + members.put(conf.getName(), conf); > > > + } > > > + } > > > + return new ConfigurationGroup(confName, members); > > > + } > > > + > > > // let's see if a configuration intersection is requested > > > String[] confs = confName.split("\\+"); > > > if (confs.length <= 1) { > > > @@ -413,32 +439,51 @@ > > > } > > > > > > public Artifact[] getArtifacts(String conf) { > > > + Configuration c = getConfiguration(conf); > > > + if (c == null) { > > > + return new Artifact[0]; > > > + } > > > Collection artifacts = (Collection) artifactsByConf.get(conf); > > > - if (artifacts == null) { > > > - Configuration c = getConfiguration(conf); > > > - if (c instanceof ConfigurationIntersection) { > > > - ConfigurationIntersection intersection = > > > (ConfigurationIntersection) c; > > > - String[] intersected = > > > intersection.getIntersectedConfigurationNames(); > > > - Set/**/ 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); > > > - } > > > + if (c instanceof ConfigurationIntersection) { > > > + ConfigurationIntersection intersection = > > > (ConfigurationIntersection) c; > > > + String[] intersected = > > > intersection.getIntersectedConfigurationNames(); > > > + Set/**/ 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]; > > > } > > > + if (artifacts != null) { > > > + intersectedArtifacts.addAll(artifacts); > > > + } > > > + return (Artifact[]) intersectedArtifacts.toArray( > > > + new Artifact[intersectedArtifacts.size()]); > > > + } else if (c instanceof ConfigurationGroup) { > > > + ConfigurationGroup group = (ConfigurationGroup) c; > > > + String[] members = group.getMembersConfigurationNames(); > > > + Set/**/ groupArtifacts = new LinkedHashSet(); > > > + for (int i = 0; i < members.length; i++) { > > > + > > > groupArtifacts.addAll(getArtifactsIncludingExtending(members[i])); > > > + } > > > + if (artifacts != null) { > > > + groupArtifacts.addAll(artifacts); > > > + } > > > + return (Artifact[]) groupArtifacts.toArray(new > > > Artifact[groupArtifacts.size()]); > > > } else { > > > - return (Artifact[]) artifacts.toArray(new > > > Artifact[artifacts.size()]); > > > + if (artifacts == null) { > > > + return new Artifact[0]; > > > + } else { > > > + return (Artifact[]) artifacts.toArray(new > > > Artifact[artifacts.size()]); > > > + } > > > } > > > } > > > > > > private Collection/**/ > > getArtifactsIncludingExtending(String > > > conf) { > > > - Collection extendingConfs = > > > Configuration.findConfigurationExtending(conf, getConfigurations()); > > > + Collection extendingConfs = > > > Configuration.findConfigurationExtending( > > > + conf, > > > getConfigurations()); > > > Set/**/ artifacts = new LinkedHashSet(); > > > Collection arts = (Collection) artifactsByConf.get(conf); > > > if (arts != null) { > > > > > > 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=789095&r1=789094&r2=789095&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 > > > Sun Jun 28 13:02:10 2009 > > > @@ -3747,6 +3747,31 @@ > > > assertFalse(getArchiveFileInCache("org2", "mod2.8", "0.6", > > > "art28-windows-debug", "jar", "jar").exists()); > > > } > > > > > > + public void testConfigurationGroups() throws Exception { > > > + // mod5.2;3.1 -> mod5.1;4.5 (*->@) > > > + // mod5.1;4.5 -> mod1.2;2.0 (B,*[axis=platform]->default) > > > + // mod5.1;4.5 -> mod2.2;0.9 > > (B,windows->myconf1;B,linux->myconf2) > > > + // mod5.1;4.5 -> mod2.1;0.5 (B,windows->A+B) > > > + // mod5.1;4.5 -> mod2.8;0.6 > > (windows,linux->@+thread+debug;A,B->*) > > > + ivy.resolve(new > > > File("test/repositories/2/mod5.2/ivy-3.1.xml").toURL(), > > > + getResolveOptions(new String[] {"B+linux"})); > > > + > > > + assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.5", > > > "art51A", "jar", "jar").exists()); > > > + assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.5", > > > "art51B", "jar", "jar").exists()); > > > + assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.5", > > > "art51B", "dll", "dll").exists()); > > > + assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.5", > > > "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()); > > > + assertTrue(getArchiveFileInCache("org2", "mod2.8", "0.6", > > > "art28-linux-debug-thread", "jar", "jar").exists()); > > > + assertFalse(getArchiveFileInCache("org2", "mod2.8", "0.6", > > > "art28-linux-debug", "jar", "jar").exists()); > > > + assertFalse(getArchiveFileInCache("org2", "mod2.8", "0.6", > > > "art28-windows-debug-thread", "jar", "jar").exists()); > > > + assertFalse(getArchiveFileInCache("org2", "mod2.8", "0.6", > > > "art28-windows-debug", "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/2/mod5.1/art51B-4.5.dll > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.dll?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > Binary file - no diff available. > > > > > > Propchange: > ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.dll > > > > > > > > > ------------------------------------------------------------------------------ > > > svn:mime-type = application/octet-stream > > > > > > Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.jar > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.jar?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > Binary file - no diff available. > > > > > > Propchange: > ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.jar > > > > > > > > > ------------------------------------------------------------------------------ > > > svn:mime-type = application/octet-stream > > > > > > Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.so > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51B-4.5.so?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > Binary file - no diff available. > > > > > > Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/ > art51B-4.5.so > > > > > > > > > ------------------------------------------------------------------------------ > > > svn:mime-type = application/octet-stream > > > > > > Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > --- ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml (added) > > > +++ ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml Sun Jun > 28 > > > 13:02:10 2009 > > > @@ -0,0 +1,45 @@ > > > + > > > + > > > + > > + module="mod5.1" > > > + revision="4.5" > > > + status="integration" > > > + publication="20090501110000" > > > + /> > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > conf="A,*[axis=platform]"/> > > > + > > conf="B,*[axis=platform]"/> > > > + > > > + > > > + > > > + > > > + > > conf="B,*[axis=platform]->default"/> > > > + > > conf="B,windows->myconf1;B,linux->myconf2"/> > > > + > > conf="B,windows->A+B"/> > > > + > > conf="windows,linux->@+thread+debug;A,B->*"/> > > > + > > > + > > > > > > Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.5.xml > > > > > > > > > ------------------------------------------------------------------------------ > > > svn:mime-type = text/plain > > > > > > Added: ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.xml > > > URL: > > > > > > http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.xml?rev=789095&view=auto > > > > > > > > > ============================================================================== > > > --- ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.xml (added) > > > +++ ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.xml Sun Jun > 28 > > > 13:02:10 2009 > > > @@ -0,0 +1,37 @@ > > > + > > > + > > > + > > + module="mod5.2" > > > + revision="3.1" > > > + status="integration" > > > + publication="20090601110000" > > > + /> > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > + > > > > > > Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.2/ivy-3.1.xml > > > > > > > > > ------------------------------------------------------------------------------ > > > svn:mime-type = text/plain > > > > > > > > > > > > > > > -- > Xavier Hanin - 4SH France > BordeauxJUG co leader - http://www.bordeauxjug.org/ > Blogger - http://xhab.blogspot.com/ > Apache Ivy Creator - http://ant.apache.org/ivy/ > --0016364167f1cbd998046e07ae5a--