Ivy
  1. Ivy
  2. IVY-45

Add type filtering at resolve time

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3-RC1
    • Component/s: Core
    • Labels:
      None

      Description

      It would be nice to be able to filter the downloaded artifacts by type of artifacts. This could be useful especially for source and javadoc management.

      See http://www.jayasoft.org/node/146 for details

        Activity

        Hide
        Xavier Hanin added a comment -

        I've began to work on this, but have no time for the moment to add unit test. However it's quite simple and have good chances to work. If someone want to test it, you can use the new type attribute on the resolve task, it accepts a comma separated list of accepted types.

        For those calling ivy from java, the resolve method may now be called with filter which will be queried before artifact downloading.

        There is also a new download method on Ivy which can be used to download artifact individually.

        Finally, a static method on DefaultArtifact let one clone an artifact with a new type. So getting the source artifact for a jar artifact can be done like this :
        Ivy ivy = ...
        Artifact jar = ...
        Artifact source = DefaultArtifact.cloneWithAnotherType(jar);
        ArtifactDownloadReport report = ivy.download(source, null);
        if (report.getDownloadStatus() != DownloadStatus.FAILED)

        { File sourceFile = ivy.getArchiveFileInCache(source); .... }
        Show
        Xavier Hanin added a comment - I've began to work on this, but have no time for the moment to add unit test. However it's quite simple and have good chances to work. If someone want to test it, you can use the new type attribute on the resolve task, it accepts a comma separated list of accepted types. For those calling ivy from java, the resolve method may now be called with filter which will be queried before artifact downloading. There is also a new download method on Ivy which can be used to download artifact individually. Finally, a static method on DefaultArtifact let one clone an artifact with a new type. So getting the source artifact for a jar artifact can be done like this : Ivy ivy = ... Artifact jar = ... Artifact source = DefaultArtifact.cloneWithAnotherType(jar); ArtifactDownloadReport report = ivy.download(source, null); if (report.getDownloadStatus() != DownloadStatus.FAILED) { File sourceFile = ivy.getArchiveFileInCache(source); .... }
        Hide
        Xavier Hanin added a comment -

        seems to work well

        Show
        Xavier Hanin added a comment - seems to work well

          People

          • Assignee:
            Xavier Hanin
            Reporter:
            Xavier Hanin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development