source: trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp @ 13367

Last change on this file since 13367 was 13367, checked in by Mark Evenson, 10 years ago

RESOLVE-DEPENDENCIES now working for remote resolution.

Something like

CL-USER> (require :abcl-asdf)
CL-USER> (abcl-asdf:resolve-dependencies "org.slf4j" "slf4j-api" "1.6.1")

should download the required dependencies for the corresponding Maven
artifact, returning the result as a string suitable for inclusion in
the CLASSPATH.

Abandoned strategy of using Maven Ant tasks to directly maniuplating
the Aether API in contemporary version of Maven 3.

Remove MVN package, folding symbols into ABCL-ASDF until clearer API
vision is in place as there is no need to complicate things at this
point.

The ASDF links are not currently working, nor is the ability to find
the Maven location under WIN32 as the resolution mechanism currently
uses UNIX 'which'.

File size: 1.3 KB
Line 
1(defpackage #:abcl-asdf
2  (:use :cl)
3  (:export 
4   #:satisfy
5   #:as-classpath
6
7   #:resolve-artifact
8   #:resolve-dependencies))
9
10(in-package :asdf)
11(defclass iri (static-class) 
12  (schema authority path query fragment))
13
14(defclass mvn (iri) ())
15
16;;; We interpret compilation to ensure that load-op will succeed
17(defmethod perform ((op compile-op) (c mvn))
18    (let ((version (component-version c)))
19      (abcl-asdf:satisfy (component-name c) 
20                         :version (if version version :latest))))
21
22(defmethod perform ((operation load-op) (c mvn))
23    (let ((version (component-version c)))
24      (java:add-to-classpath 
25       (abcl-asdf:as-classpath 
26        (abcl-asdf:satisfy (component-name c)
27                     :version (if version version :latest))))))
28
29(in-package #:abcl-asdf)
30
31(defun satisfy (name &key (version :latest))
32  (declare (ignore version))
33  (resolve-dependencies name))
34           
35(defun as-classpath (classpath)
36  "For a given MVN entry, return a list of loadable archives
37 suitable for addition to the classpath."
38  (split-string classpath ":"))
39
40(defun split-string (string split-char)
41  (loop :for i = 0 :then (1+ j)
42     :as j = (position split-char string :test #'string-equal :start i)
43     :collect (subseq string i j)
44     :while j))
Note: See TracBrowser for help on using the repository browser.