Ivy
  1. Ivy
  2. IVY-395

Enhance <info/> task to access the 'publication', 'branch' and published artifacts as ant propeties.

    Details

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

      Description

      The pubblication attribute on <info /> element in IVY file is very useful.

      When the attribute is not specified IVY set the attribute to the current timestamp.

      It would be very useful to access to 'publication' attribute from ANT during artifacts build using a $

      {ivy.publication}

      property.

      Using ANT task <tstamp /> to simulate that can create incoherent situation because the two timestamps are not 'synchronized'

      Similarly, a property for the 'branch' attribute could be added.

      Access to the published artifacts declared in the ivy file as ant properties would also be useful. This would allow a multi-project build system with a common build file define the produced artifacts solely in the Ivy file and have the common build file retrieve the names of the artifacts that it needs to create from that ivy file via the <info/> task.

      1. ivy-395-3.patch
        15 kB
        Carl Quinn
      2. ivy-395-2.patch
        9 kB
        Carl Quinn
      3. ivy-395.patch
        9 kB
        Carl Quinn

        Activity

        Hide
        Maarten Coene added a comment -

        I've applied your patch into SVN trunk.
        Thanks a lot for the contribution!

        Show
        Maarten Coene added a comment - I've applied your patch into SVN trunk. Thanks a lot for the contribution!
        Hide
        Carl Quinn added a comment -

        Sure!

        Show
        Carl Quinn added a comment - Sure!
        Hide
        Maarten Coene added a comment -

        Thanks a lot!
        Do you think you could also patch the documentation of the ivy:info Ant task?

        Show
        Maarten Coene added a comment - Thanks a lot! Do you think you could also patch the documentation of the ivy:info Ant task?
        Hide
        Carl Quinn added a comment -

        Oh, and I implemented your first suggestion which I already had in mind. That ends up being quite easy to iterate over in Ant.

        Show
        Carl Quinn added a comment - Oh, and I implemented your first suggestion which I already had in mind. That ends up being quite easy to iterate over in Ant.
        Hide
        Carl Quinn added a comment -

        Good point. I almost did it that way first, and then blindly copied the conf pattern, forgetting that artifact names might not be unique.

        This code is just as nice. I've attached an updated patch.

        Show
        Carl Quinn added a comment - Good point. I almost did it that way first, and then blindly copied the conf pattern, forgetting that artifact names might not be unique. This code is just as nice. I've attached an updated patch.
        Hide
        Maarten Coene added a comment -

        Thanks for the patch Carl.

        I see one problem: it is possible to define within 1 ivy.xml multiple artifacts with the same name.
        In your patch only one of these artifacts will be available as Ant properties.

        Maybe you could change the properties to something like?
        <property>.artifact.1.name="myartifact"
        <property>.artifact.1.type="jar"
        <property>.artifact.1.ext="jar"
        <property>.artifact.1.confs="default,test"
        <property>.artifact.2.name="myartifact"
        <property>.artifact.2.type="sources"
        <property>.artifact.2.ext="jar"
        <property>.artifact.2.confs="source"
        <property>.artifact.3.name=yourartifact

        or

        <property>.artifact.myartifact.1.type="jar"
        <property>.artifact.myartifact.1.ext="jar"
        <property>.artifact.myartifact.1.confs="default,test"
        <property>.artifact.myartifact.2.type="sources"
        <property>.artifact.myartifact.2.ext="jar"
        <property>.artifact.myartifact.2.confs="source"
        <property>.artifact.yourartifact.1.type=...

        Show
        Maarten Coene added a comment - Thanks for the patch Carl. I see one problem: it is possible to define within 1 ivy.xml multiple artifacts with the same name. In your patch only one of these artifacts will be available as Ant properties. Maybe you could change the properties to something like? <property>.artifact.1.name="myartifact" <property>.artifact.1.type="jar" <property>.artifact.1.ext="jar" <property>.artifact.1.confs="default,test" <property>.artifact.2.name="myartifact" <property>.artifact.2.type="sources" <property>.artifact.2.ext="jar" <property>.artifact.2.confs="source" <property>.artifact.3.name=yourartifact or <property>.artifact.myartifact.1.type="jar" <property>.artifact.myartifact.1.ext="jar" <property>.artifact.myartifact.1.confs="default,test" <property>.artifact.myartifact.2.type="sources" <property>.artifact.myartifact.2.ext="jar" <property>.artifact.myartifact.2.confs="source" <property>.artifact.yourartifact.1.type=...
        Hide
        Carl Quinn added a comment -

        Is anyone still interested in the improvement? This is something that I needed for my builds, so I went ahead and extended IvyInfo to do this.

        I've attached a patch that is based on the latest trunk (908304) that includes these changes as well as a unit test and associated ivy test file. Let me know if you'd like me to make changes or submit these in a different form.

        Show
        Carl Quinn added a comment - Is anyone still interested in the improvement? This is something that I needed for my builds, so I went ahead and extended IvyInfo to do this. I've attached a patch that is based on the latest trunk (908304) that includes these changes as well as a unit test and associated ivy test file. Let me know if you'd like me to make changes or submit these in a different form.
        Hide
        Ross Clewley added a comment -

        As requested by Xavier, I've expanded this issue to incorporate all of the <info/> task enhancements that have been discussed recently on the mailing list.

        Show
        Ross Clewley added a comment - As requested by Xavier, I've expanded this issue to incorporate all of the <info/> task enhancements that have been discussed recently on the mailing list.

          People

          • Assignee:
            Maarten Coene
            Reporter:
            paolo di tommaso
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development