views:

99

answers:

1

Is it possible to use Ivy, or some other dependency-management tool, if your dependencies are directories instead of files?

I'm creating a PHP web site, so my shared "libraries" aren't jar files or any other archive format. I'm aware of .phar files in PHP 5.3, but I really would prefer these to be directories, so the web server can serve their contents directly.

+1  A: 

You can't depend upon a directory, but you can package your dependencies as a zip, then tell Ivy to unpack them on download. This means when your application is built they will be available locally to the web server.

The packager provides an optional dest attribute that can be specified to unpack the archive to a sub folder. The following config should unpack the dependency to sub/dir:

<property name="zipname" value="${name}-${version}"/>

<resource dest="sub/dir" url="http://testng.org/${zipname}.zip" 
  sha1="2ea19275dc17453306f8bb780fe6ef6e9af7756b">
    <url href="http://mirror.example.com/archives/${zipname}.zip"/&gt;
    <include name="${zipname}/src/main/**/*"/>
    <include name="${zipname}/src/jdk15/**/*"/>
    <include name="${zipname}/javadocs/**/*"/>
    <include name="${zipname}/*.jar"/>
</resource>
Rich Seller