Depends

Depends is a basic dependency management system inspired by bundler. The basic idea is that you have some dependencies that need to be put in place in order to begin developing your application. Our use case is that we have a number of libraries such as OpenSSL, xsd, qt, etc... that we want to precompile and link the results at (our) application build time. We don't want to check these into source countrol, but we want them to be versioned along-side source control.

Introducting Depends

Depends is quite simple.

  1. Install depends (I am assuming that ruby is already installed)
gem install depends-client
  1. Define a Depends file at the root of your source repository. The format is as follows:

    
    source :depends
    
    depend 'Qt', :version => '4', :destination => 'External/Qt'
    depend 'SevenZipSharp', :version => '4', :destination => 'External/SevenZipSharp'
    depend 'Sqlite', :version => '4', :destination => 'External/Sqlite'
    depend 'Xerces', :version => '4', :destination => 'External/Xerces'
    depend 'Xsd', :version => '4', :destination => 'External/Xsd'
    
    

    source defines that location of the depends server. Currently :local, :depends, or a string to some other depends server, i.e. http://example.com.

    depend defines what the dependency is, the version to install and the path to unpack it to

  2. Execute Depends

    depend
    
  3. Add your Depends file to source control

We also recomend that you add depends destinations to your gitignore and hgignore files.

Your done, packages are download, extracted and installed per the instructions in your gem file

Uploading A Dependency

This tutorial does not cover installing a depends server, but asuming that you have a depends server setup, adding a new dependency is simple.

  1. Install Depends

    gem install depends
    
  2. Setup a directory that models what you want to upload. I.e. Create /tmp/openssl and add some files to it.

  3. Package and upload

    depend upload -s /tmp/openssl -d 'depends' -n "OpenSSL" -v '1.2.3b'
    

That's it, your package is created and uploaded to the depends server.

The Future

  • Polish the client a bit further
  • Better error handling
  • Auto Updating of .gitignore and .hgignore files based on your Depends
  • Windows support
  • Rake tasks