abcl-asdf.lisp 940 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
(defpackage #:abcl-asdf
  (:use :cl)
  (:export #:package))

(in-package :asdf-jar)

(in-package :asdf)
(defclass iri (static-class) ())

(defclass mvn (iri) ())

;;; We interpret compilation to ensure that load-op will succeed
(defmethod perform ((operation compile-op) (component mvn))
    (let ((version (component-version mvn)))
      (mvn:satisfy (component-name mvn) 
                   :version (if version version :latest))))

(defmethod perform ((operation load-op) (component mvn))
    (let ((version (component-version mvn)))
      (java:add-to-classpath 
       (as-classpath (mvn:satisfy (component-name mvn)
                                  :version (if version version :latest))))))

(defun decompose (iri) 
  ;;; XXX test 
  `((:scheme :jvm)
    (:authority :mvn)
    (:host "log4j")
    (:version "1.4.10")))

(defun mvn:satisfy (name &key (version :latest))
  ;;; XXX either invoke mvn in the same jvm or fork a process)