Can I publish a directory using Ivy?

2019-03-06 19:13发布

问题:

I have a python lib, and I want to use Ivy to manage my private libraries.

I python lib file structure looks like:

mylib\
    __init__.py
    f1.py
    f2.py
    ...

Now I want to publish mylib as a whole, instead file by file. In Ivy, I know how to publish one file by using the artifact tag. But how can I publish the whole directory?

回答1:

The problem with a directory is that it's not very easy to version it's contents... The most common solution to this problem is to create a tar or zip package and publish this to your repository.

3rd party builds consuming the directory can either download and unpack it, or alternatively use the packager resolver to access files inside the package.

The packager resolver does add some complexity, but it's a very powerful feature of ivy. The ivy roundup is an example of an ivy repository designed to hold packager files, making it easier to consume artifacts not available via normal repositories.

Finally, the following answers gives packager resolver examples:

  • gradle - how to declare a dependency of a jar in a jar
  • Issues using ivy
  • ivy dependency on external JAR
  • Ivy Custom Resolvers for Git or TFS
  • Apache Ivy: resolving dependencies embedded in an installer


标签: python ivy