On Oct 20, 4:21 pm, Drakeson <[email protected]> wrote:
> How about a system that deduces external dependencies out of (ns ...)
> calls from a project, and possibly consults an extra file (e.g.,
> ./.dependencies) for the whole project that contains information like
> below, in order to deduce the version required for the library.
>
>   [org.apache.commons.codec 1.4]
>   [org.apache.commons.httpclient 3.1]

That's a nice idea, but it wouldn't fit into the current system I had
in mind, I'm afraid. My idea is to allow people to register accounts,
and then to let them upload whatever packages they wish within that
account.

For instance, the user "pparker" might decide to upload a Jar for
apache-commons-codec 1.4, and this would be accessible via the ID
"pparker/apache-commons-codec/1.4". If another user, "bwayne" comes
along and uploads the same Jar to his account, he'd have package at
the ID "bwayne/apache-commons-codec/1.4".

My theory is that if uploading a new package takes only a few seconds,
there is no need to support existing repositories like Maven or Ivy.

Eventually I might introduce a way of vetting packages so that the
account name can be dropped, in which case I'd be able to use your
scheme for putting version numbers on packages. But that's a feature
for after version 1.0, I think :)

> Per file assertion of the library version, without the need for an
> external .dependencies file is nice for small single file projects /
> scripts.  In that case maybe it is possible (by the way of with-ns
> 'clojure.core), to instruct :import statements to look into meta-data
> of imported libraries:

Ah, I'm actually a little ahead of you there. I decided to use
metadata on the namespace to denote the dependencies. Using metadata
has the obvious advantage of allowing people to use the library
without needing Capra installed. But if Capra is installed, it
overrides in-ns to automatically download any dependent packages:

(ns #^{:deps ["pparker/apache-commons-codec/1.4"]}
  example
  (:import org.apache.commons.codec.digest.DigestUtils))

Capra and Capra-server are currently fully functional, but need a bit
more work and validations before I put them into public beta.

- James
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to