Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 75206 invoked from network); 4 Sep 2008 06:08:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2008 06:08:52 -0000 Received: (qmail 61281 invoked by uid 500); 4 Sep 2008 06:08:50 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 61257 invoked by uid 500); 4 Sep 2008 06:08:50 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 61248 invoked by uid 99); 4 Sep 2008 06:08:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 23:08:50 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 06:08:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9EED1238889D; Wed, 3 Sep 2008 23:08:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r691877 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/ConfigurationUtils.java test/java/org/apache/ivy/ant/IvyResolveTest.java Date: Thu, 04 Sep 2008 06:08:01 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080904060801.9EED1238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: maartenc Date: Wed Sep 3 23:08:00 2008 New Revision: 691877 URL: http://svn.apache.org/viewvc?rev=691877&view=rev Log: FIX: Enable consistent support of the configuration negation operator (IVY-894) Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691877&r1=691876&r2=691877&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 3 23:08:00 2008 @@ -111,6 +111,7 @@ - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed from the cache (IVY-883) - IMPROVEMENT: Improve performance (IVY-872) +- FIX: Enable consistent support of the configuration negation operator (IVY-894) - FIX: add variable expansion in extra attributes (IVY-798) - FIX: Invalid URL when using dynamic ranges (IVY-885) - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java?rev=691877&r1=691876&r2=691877&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java Wed Sep 3 23:08:00 2008 @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; +import java.util.Iterator; import org.apache.ivy.core.module.descriptor.Configuration; import org.apache.ivy.core.module.descriptor.ModuleDescriptor; @@ -61,6 +62,7 @@ } Set result = new LinkedHashSet(); + Set excluded = new LinkedHashSet(); for (int i = 0; i < confs.length; i++) { if ("*".equals(confs[i])) { result.addAll(Arrays.asList(md.getConfigurationsNames())); @@ -78,10 +80,15 @@ result.add(all[j].getName()); } } + } else if (confs[i].startsWith("!")) { + excluded.add(confs[i].substring( 1 )); } else { result.add(confs[i]); } } + for (Iterator iter = excluded.iterator(); iter.hasNext();) { + result.remove(iter.next()); + } return (String[]) result.toArray(new String[result.size()]); } Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=691877&r1=691876&r2=691877&view=diff ============================================================================== --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java (original) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Wed Sep 3 23:08:00 2008 @@ -388,6 +388,17 @@ assertNotNull(project.getReference("ivy.resolved.configurations.ref.testWithResolveId")); } + public void testExcludedConf() throws Exception { + resolve.setFile(new File("test/java/org/apache/ivy/ant/ivy-multiconf.xml")); + resolve.setConf("*,!default"); + resolve.execute(); + + assertTrue(getIvyFileInCache( + ModuleRevisionId.newInstance("org1", "mod1.1", "2.0")).exists()); + assertFalse(getIvyFileInCache( + ModuleRevisionId.newInstance("org1", "mod1.2", "2.0")).exists()); + } + public void testResolveWithAbsoluteFile() { // IVY-396 File ivyFile = new File("test/java/org/apache/ivy/ant/ivy-simple.xml");