nasser / nostrand

Clojure on Mono
68 stars 11 forks source link

Manage Dependencies #4

Closed nasser closed 7 years ago

nasser commented 7 years ago

In order to support medium to large projects, nostrand should be able to manage dependencies the way lein or boot does. This is complicated by the fact that we are on the CLR which means that 1) consuming Java packages from Maven is useless and 2) consuming packages from NuGet is desirable.

My current prototype is the Dependency Acquisition and Management Namespace, or damn which support lein-like coordinates to packages, with the addition of a leading keyword that indicates their source.

(depend [[:maven org.clojure/tools.analyzer "0.6.8-SNAPSHOT"]
         [:nuget OpenTK "2.0.0"]
         [:github nasser/tools.analyzer.clr master :paths ["src"]]
         [:github nasser/magic master]
         [:github nasser/mage master]])

The above example pulls in Clojure source for org.clojure/tools.analyzer from maven central/clojars, OpenTK binaries from NuGet, and the contents of three GitHub repositories.

Implementing a source involves two multimethods:

  1. (acquire! options coordinate) downloads the necessary files
  2. (paths options coordinates) returns the paths within the downloaded files to be added to the load path and scanned for assemblies
nasser commented 7 years ago

A first pass at this landed in 3bf791a3dae1d1c41a71668d57f3c589094ce8c1, closing.