Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 26381 invoked from network); 28 Mar 2008 23:25:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2008 23:25:00 -0000 Received: (qmail 1259 invoked by uid 500); 28 Mar 2008 23:24:59 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 1240 invoked by uid 500); 28 Mar 2008 23:24:59 -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 1231 invoked by uid 99); 28 Mar 2008 23:24:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 16:24:59 -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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 23:24:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B5EC11A983A; Fri, 28 Mar 2008 16:24:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r642425 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/ant/IvyPostResolveTask.java test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java Date: Fri, 28 Mar 2008 23:24:39 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080328232439.B5EC11A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: maartenc Date: Fri Mar 28 16:24:38 2008 New Revision: 642425 URL: http://svn.apache.org/viewvc?rev=642425&view=rev Log: FIX: multiple cleancache and inline retrieve error (IVY-778) Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=642425&r1=642424&r2=642425&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Fri Mar 28 16:24:38 2008 @@ -75,6 +75,7 @@ - IMPROVEMENT: Parse description and home page from poms (IVY-767) - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher and GlobPatternMatcher +- FIX: multiple cleancache and inline retrieve error (IVY-778) - FIX: buildlist evicts modules with the same name, but different organisation (IVY-731) - FIX: Out of memory/Stack overflow for new highly coupled project (IVY-595) - FIX: Compatibility with maven's dependencyMangement (IVY-753) (not completed yet) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java?rev=642425&r1=642424&r2=642425&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyPostResolveTask.java Fri Mar 28 16:24:38 2008 @@ -20,8 +20,10 @@ import java.io.File; import java.util.Arrays; import java.util.HashSet; +import java.util.Iterator; import org.apache.ivy.Ivy; +import org.apache.ivy.core.cache.ResolutionCacheManager; import org.apache.ivy.core.module.descriptor.ModuleDescriptor; import org.apache.ivy.core.module.id.ModuleId; import org.apache.ivy.core.module.id.ModuleRevisionId; @@ -245,7 +247,24 @@ } else { confs = splitConfs(conf); } + HashSet rconfsSet = new HashSet(Arrays.asList(rconfs)); + + // for each resolved configuration, check if the report still exists + ResolutionCacheManager cache = getSettings().getResolutionCacheManager(); + for (Iterator it = rconfsSet.iterator(); it.hasNext(); ) { + String resolvedConf = (String) it.next(); + String resolveId = getResolveId(); + if (resolveId == null) { + resolveId = ResolveOptions.getDefaultResolveId(reference); + } + File report = cache.getConfigurationResolveReportInCache(resolveId, resolvedConf); + if (!report.exists()) { + // the report doesn't exist any longer, we have to recreate it... + it.remove(); + } + } + HashSet confsSet = new HashSet(Arrays.asList(confs)); Message.debug("resolved configurations: " + rconfsSet); Message.debug("asked configurations: " + confsSet); Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml?rev=642425&view=auto ============================================================================== --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml (added) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml Fri Mar 28 16:24:38 2008 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java?rev=642425&view=auto ============================================================================== --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java (added) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveBuildFileTest.java Fri Mar 28 16:24:38 2008 @@ -0,0 +1,36 @@ +/* + * 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.ant; + +import org.apache.ivy.core.report.ResolveReport; +import org.apache.tools.ant.BuildFileTest; + +public class IvyRetrieveBuildFileTest extends BuildFileTest { + + protected void setUp() throws Exception { + configureProject("test/java/org/apache/ivy/ant/IvyRetrieveBuildFile.xml"); + } + + public void testMultipleInlineRetrievesWithCacheCleaning() { + executeTarget("testMultipleInlineRetrievesWithCacheCleaning"); + ResolveReport report = (ResolveReport) getProject().getReference("ivy.resolved.report"); + assertNotNull(report); + assertFalse(report.hasError()); + assertEquals(1, report.getDependencies().size()); + } +}