Changeset 14365


Ignore:
Timestamp:
01/31/13 14:26:25 (11 years ago)
Author:
Mark Evenson
Message:

abcl-asdf: fix bug to use the version of specified MVN components.

Reformat to SLIME whitespace conventions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/abcl-asdf/abcl-asdf.lisp

    r14364 r14365  
    1818   (classname :initarg :classname :initform nil)
    1919   (alternate-uri :initarg :alternate-uri :initform nil)
    20 ;; inherited from ASDF:COMPONENT ??? what are the CL semantics on overriding -- ME 2012-04-01
    21 #+nil   (version :initform nil)))
     20   ;; inherited from ASDF:COMPONENT ??? what are the CL semantics on overriding -- ME 2012-04-01
     21   #+nil   (version :initform nil)))
    2222
    2323#+nil
     
    3030  (abcl-asdf:resolve   
    3131   (ensure-parsed-mvn c)))
    32      
     32
    3333(defmethod perform ((operation load-op) (c mvn))
    3434  (let ((resolved-path
     
    5959(defun ensure-parsed-mvn (component)
    6060  (with-slots (name group-id artifact-id
    61                version schema path repository)
     61                    version schema path repository)
    6262      component
    6363    (when (null asdf::artifact-id)
     
    9898
    9999(defgeneric resolve (something)
    100  (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string."))
     100  (:documentation "Returns a string in JVM CLASSPATH format as entries delimited by classpath separator string."))
    101101
    102102(defmethod resolve ((mvn-component asdf::mvn))
     
    107107denotes that current JVM already has already loaded a given class. Can possibly be a
    108108single entry denoting a remote binary artifact."
    109   (macrolet ((aif (something consequence alternative))
    110              `(let ((it ,(something)))
    111                 (if it
    112                     consequence
    113                     alternative)))
    114     (let ((name (slot-value mvn-component 'asdf::name))
    115           (group-id (slot-value mvn-component 'asdf::group-id))
    116           (artifact-id (slot-value mvn-component 'asdf::artifact-id))
    117           (classname (slot-value mvn-component 'asdf::classname))
    118           (alternate-uri (slot-value mvn-component 'asdf::alternate-uri))
    119           (version (let ((it (slot-value mvn-component 'asdf::version)))
    120                      (cond
    121                        ((not it)
    122                         it)
    123                        (t
    124                         "LATEST")))))
    125       (handler-case
    126           (when (and classname
    127                      (jss:find-java-class classname))
    128             (warn "Not loading ~A from the network because ~A is present in classpath."
    129                   name classname)
    130             (return-from resolve t))
    131         (java:java-exception (e)
    132           (unless (java:jinstance-of-p (java:java-exception-cause e)
    133                                   "java.lang.ClassNotFoundException")
    134             (error "Unexpected Java exception~&~A.~&" e))))
    135       (if (find-mvn)
    136           (resolve-dependencies group-id artifact-id version)
    137           (if alternate-uri
    138               (values (namestring alternate-uri) alternate-uri)
    139               (t
    140                (error "Failed to resolve MVN component name ~A." name)))))))
    141  
     109  (let ((name (slot-value mvn-component 'asdf::name))
     110        (group-id (slot-value mvn-component 'asdf::group-id))
     111        (artifact-id (slot-value mvn-component 'asdf::artifact-id))
     112        (classname (slot-value mvn-component 'asdf::classname))
     113        (alternate-uri (slot-value mvn-component 'asdf::alternate-uri))
     114        (version (if (slot-value mvn-component 'asdf::version)
     115                     (slot-value mvn-component 'asdf::version)
     116                     "LATEST")))
     117    (handler-case
     118        (when (and classname
     119                   (jss:find-java-class classname))
     120          (warn "Not loading ~A from the network because ~A is present in classpath."
     121                name classname)
     122          (return-from resolve t))
     123      (java:java-exception (e)
     124        (unless (java:jinstance-of-p (java:java-exception-cause e)
     125                                     "java.lang.ClassNotFoundException")
     126          (error "Unexpected Java exception~&~A.~&" e))))
     127    (if (find-mvn)
     128        (resolve-dependencies group-id artifact-id version)
     129        (if alternate-uri
     130            (values (namestring alternate-uri) alternate-uri)
     131            (t
     132             (error "Failed to resolve MVN component name ~A." name))))))
     133
    142134(defun as-classpath (classpath)
    143135  "Break apart the JVM CLASSPATH string into a list of its consituents."
Note: See TracChangeset for help on using the changeset viewer.