You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by xa...@apache.org on 2008/03/27 17:59:04 UTC

svn commit: r641893 - in /ant/ivy/core/trunk: src/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/core/resolve/ test/repositories/extra-attributes/module2/ test/repositories/extra-attributes/module2/task2/ test/repositories/extra-attributes/...

Author: xavier
Date: Thu Mar 27 09:58:52 2008
New Revision: 641893

URL: http://svn.apache.org/viewvc?rev=641893&view=rev
Log:
fix new bug introduced in attempt to fix IVY-773

Added:
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-linux.jar   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-windows.jar   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/
    ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/
    ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-linux.jar   (with props)
    ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-windows.jar   (with props)
Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java?rev=641893&r1=641892&r2=641893&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java Thu Mar 27 09:58:52 2008
@@ -259,9 +259,13 @@
         if (loaded) {
             useRealNode();
 
-            // if the revision was a dynamic one (which has now be resolved)
-            // we now register this node on the resolved id
-            if (data.getSettings().getVersionMatcher().isDynamic(getId())) {
+            // if the loaded revision is different from original one
+            // we now register this node on the new resolved id
+            // this includes two cases:
+            // - the id refers to a dynamic revision, which has been resolved by loadData
+            // - the loaded module descriptor has extra attributes in his info tag which are not 
+            //   used when declaring the dependency
+            if (!getId().equals(node.getResolvedId())) {
                 data.register(node.getResolvedId(), this);
             }
         }

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=641893&r1=641892&r2=641893&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 Mar 27 09:58:52 2008
@@ -3788,6 +3788,25 @@
         assertTrue(new File(cache, "apache/mymodule/task1/1854/mymodule-linux.jar").exists());
     }
 
+    public void testExtraAttributes2() throws Exception {
+        // test case for IVY-773
+        Ivy ivy = new Ivy();
+        ivy.configure(new File("test/repositories/extra-attributes/ivysettings.xml"));
+        ivy.getSettings().setDefaultCache(cache);
+
+        ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-extra-att2.xml"),
+            getResolveOptions(ivy.getSettings(), new String[] {"*"}).setValidate(false));
+        assertFalse(report.hasError());
+
+        assertTrue(new File(cache, "apache/mymodule/task2/1748/ivy.xml").exists());
+        assertTrue(new File(cache, "apache/mymodule/task2/1748/mymodule-windows.jar").exists());
+        assertTrue(new File(cache, "apache/mymodule/task2/1748/mymodule-linux.jar").exists());
+
+        assertTrue(new File(cache, "apache/module2/task2/1976/ivy.xml").exists());
+        assertTrue(new File(cache, "apache/module2/task2/1976/module2-windows.jar").exists());
+        assertTrue(new File(cache, "apache/module2/task2/1976/module2-linux.jar").exists());
+    }
+
     public void testNamespaceExtraAttributes() throws Exception {
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/extra-attributes/ivysettings.xml"));

Added: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml?rev=641893&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml (added)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml Thu Mar 27 09:58:52 2008
@@ -0,0 +1,24 @@
+<!--
+   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="apache" module="extra-att" revision="1.0"/>
+    <dependencies>
+		<dependency name="mymodule" eatt="task2" rev="1748" />
+    </dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-extra-att2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml?rev=641893&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml (added)
+++ ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml Thu Mar 27 09:58:52 2008
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   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="apache"
+        module="module2"
+        eatt="task2"
+        eatt2="test"
+        revision="1976"
+        status="integration">
+	</info>
+	<publications>
+		<artifact platform="windows" type="jar"/>
+		<artifact platform="linux" type="jar"/>
+	</publications>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-linux.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-linux.jar?rev=641893&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-linux.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-windows.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-windows.jar?rev=641893&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/module2/task2/1976/module2-windows.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml?rev=641893&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml (added)
+++ ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml Thu Mar 27 09:58:52 2008
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+   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="apache"
+        module="mymodule"
+        eatt="task2"
+        eatt2="test"
+        revision="1748"
+        status="integration">
+	</info>
+	<publications>
+		<artifact name="mymodule" platform="windows" type="jar"/>
+		<artifact name="mymodule" platform="linux" type="jar"/>
+	</publications>
+    <dependencies>
+		<dependency name="module2" eatt="task2" rev="1976" />
+    </dependencies>
+</ivy-module>

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-linux.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-linux.jar?rev=641893&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-linux.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-windows.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-windows.jar?rev=641893&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ant/ivy/core/trunk/test/repositories/extra-attributes/mymodule/task2/1748/mymodule-windows.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream