Ivy
  1. Ivy
  2. IVY-1281

Support dynamic revisions in <extends> tag

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-RC1
    • Component/s: Core
    • Labels:
      None

      Description

      Current implementation of inheritance feature doesn't support dynamic revisions in <extends> tag.

      1. IVY-1281+1287.patch
        24 kB
        Jean-Louis Boudart

        Activity

        Hide
        Maarten Coene added a comment -

        Patch has been applied in SVN trunk.
        Many thanks!

        Show
        Maarten Coene added a comment - Patch has been applied in SVN trunk. Many thanks!
        Hide
        Jean-Louis Boudart added a comment -

        Please find the updated patch, i just run all tests, everything seems ok now.
        Sorry for the successive test failures

        Show
        Jean-Louis Boudart added a comment - Please find the updated patch, i just run all tests, everything seems ok now. Sorry for the successive test failures
        Hide
        Maarten Coene added a comment -

        Thanks for the updated patch Jean-Louis.
        Unfortunately another test is failing now:

        junit.framework.ComparisonFailure: expected:<...module"
        		revision="[working@Vostro]"
        		status="integrat...> but was:<...module"
        		revision="[myrev]"
        		status="integrat...>
        	at junit.framework.Assert.assertEquals(Assert.java:81)
        	at junit.framework.Assert.assertEquals(Assert.java:87)
        	at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriterTest.testExtends(XmlModuleDescriptorWriterTest.java:125)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:324)
        	at junit.framework.TestCase.runTest(TestCase.java:164)
        	at junit.framework.TestCase.runBare(TestCase.java:130)
        	at junit.framework.TestResult$1.protect(TestResult.java:106)
        	at junit.framework.TestResult.runProtected(TestResult.java:124)
        	at junit.framework.TestResult.run(TestResult.java:109)
        	at junit.framework.TestCase.run(TestCase.java:120)
        	at junit.framework.TestSuite.runTest(TestSuite.java:230)
        	at junit.framework.TestSuite.run(TestSuite.java:225)
        	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        
        Show
        Maarten Coene added a comment - Thanks for the updated patch Jean-Louis. Unfortunately another test is failing now: junit.framework.ComparisonFailure: expected:<...module" revision="[working@Vostro]" status="integrat...> but was:<...module" revision="[myrev]" status="integrat...> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriterTest.testExtends(XmlModuleDescriptorWriterTest.java:125) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        Hide
        Jean-Louis Boudart added a comment -

        Added correction of IVY-1287 in the patch.
        Using properties in extend tag's attributes was not supported.

        Added support of a new extendType for licenses.

        Show
        Jean-Louis Boudart added a comment - Added correction of IVY-1287 in the patch. Using properties in extend tag's attributes was not supported. Added support of a new extendType for licenses.
        Hide
        Jean-Louis Boudart added a comment -

        My bad, when using forcedeliver we were corrupting the original module.ivy. It should be fixed in the new patch.

        I also fixed a tiny bug when merging revision from parent. We checked for null value, but revision is never null.
        When revision is null ivy set it with "working@[HOSTNAME".

        Show
        Jean-Louis Boudart added a comment - My bad, when using forcedeliver we were corrupting the original module.ivy. It should be fixed in the new patch. I also fixed a tiny bug when merging revision from parent. We checked for null value, but revision is never null. When revision is null ivy set it with "working@[HOSTNAME".
        Hide
        Maarten Coene added a comment -

        I've tried to apply your patch, but the new unit test is failing:

        apache#resolve-extends;1.0: java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml)
        	at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:426)
        	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
        	at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:308)
        	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
        	at org.apache.ivy.ant.IvyPublishTest.testMergeParentWithoutPublishingParentForceDeliver(IvyPublishTest.java:218)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:324)
        	at junit.framework.TestCase.runTest(TestCase.java:164)
        	at junit.framework.TestCase.runBare(TestCase.java:130)
        	at junit.framework.TestResult$1.protect(TestResult.java:106)
        	at junit.framework.TestResult.runProtected(TestResult.java:124)
        	at junit.framework.TestResult.run(TestResult.java:109)
        	at junit.framework.TestCase.run(TestCase.java:120)
        	at junit.framework.TestSuite.runTest(TestSuite.java:230)
        	at junit.framework.TestSuite.run(TestSuite.java:225)
        	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        Caused by: java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml)
        	at org.apache.ivy.core.deliver.DeliverEngine.deliver(DeliverEngine.java:112)
        	at org.apache.ivy.Ivy.deliver(Ivy.java:597)
        	at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:423)
        	... 22 more
        --- Nested Exception ---
        java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml)
        	at org.apache.ivy.core.deliver.DeliverEngine.deliver(DeliverEngine.java:112)
        	at org.apache.ivy.Ivy.deliver(Ivy.java:597)
        	at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:423)
        	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
        	at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:308)
        	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
        	at org.apache.ivy.ant.IvyPublishTest.testMergeParentWithoutPublishingParentForceDeliver(IvyPublishTest.java:218)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:324)
        	at junit.framework.TestCase.runTest(TestCase.java:164)
        	at junit.framework.TestCase.runBare(TestCase.java:130)
        	at junit.framework.TestResult$1.protect(TestResult.java:106)
        	at junit.framework.TestResult.runProtected(TestResult.java:124)
        	at junit.framework.TestResult.run(TestResult.java:109)
        	at junit.framework.TestCase.run(TestCase.java:120)
        	at junit.framework.TestSuite.runTest(TestSuite.java:230)
        	at junit.framework.TestSuite.run(TestSuite.java:225)
        	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
        	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        
        Show
        Maarten Coene added a comment - I've tried to apply your patch, but the new unit test is failing: apache#resolve-extends;1.0: java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml) at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:426) at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:308) at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) at org.apache.ivy.ant.IvyPublishTest.testMergeParentWithoutPublishingParentForceDeliver(IvyPublishTest.java:218) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml) at org.apache.ivy.core.deliver.DeliverEngine.deliver(DeliverEngine.java:112) at org.apache.ivy.Ivy.deliver(Ivy.java:597) at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:423) ... 22 more --- Nested Exception --- java.lang.IllegalStateException: ivy file not found in cache for apache#resolve-extends;1.0: please resolve dependencies before delivering (C:\projects\ivy\ivy-dev\build\cache\resolved-apache-resolve-extends-1.0.xml) at org.apache.ivy.core.deliver.DeliverEngine.deliver(DeliverEngine.java:112) at org.apache.ivy.Ivy.deliver(Ivy.java:597) at org.apache.ivy.ant.IvyDeliver.doExecute(IvyDeliver.java:423) at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:308) at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) at org.apache.ivy.ant.IvyPublishTest.testMergeParentWithoutPublishingParentForceDeliver(IvyPublishTest.java:218) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        Hide
        Jean-Louis Boudart added a comment -

        Here is a patch including a refactoring to support dynamic revisions in <extends> tag.
        It also contains a new unit test.

        Show
        Jean-Louis Boudart added a comment - Here is a patch including a refactoring to support dynamic revisions in <extends> tag. It also contains a new unit test.

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Jean-Louis Boudart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development