Ignore:
Timestamp:
10/13/12 09:12:36 (8 years ago)
Author:
Mark Evenson
Message:

abcl-asdf: special case handling for finding com.sun.jna.Native et. al.

Fallback to finding 'jna.jar' via Maven is to download it ourselves.

Undefined what having a URI in your classpath means to your local JVM
implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/mvn/jna.asd

    r14191 r14192  
    44(asdf:defsystem :jna
    55    :version "3.4.0"
    6     :defsystem-depends-on (jss abcl-asdf))
    7 ;; FIXME:  install a better handler in abcl-asdf  :components ((:mvn "net.java.dev.jna/jna/3.4.0")))
     6    :defsystem-depends-on (jss abcl-asdf)
     7;; FIXME:
     8    :components ((:mvn "net.java.dev.jna/jna/3.4.0")))
    89
    9 (defmethod asdf:perform :after ((o asdf:load-op) (c (eql (asdf:find-system :jna))))
     10(in-package :asdf)
     11(defmethod perform :after ((o load-op) (c (eql (find-system :jna))))
    1012  (when (jss:find-java-class "com.sun.jna.Native")
    1113    (provide :jna)))
    1214
    13 (defmethod asdf:perform :before ((o asdf:load-op) (c (eql (asdf:find-system :jna))))
     15;;; After ASDF performs COMPILE-OP, one expects that the JNA Java
     16;;; classes can be instantiated.  If not, execute various loading strategies.
     17(defmethod perform ((o compile-op) (c (eql (find-system :jna))))
    1418  ;; Theoretically this should be the same thing as the MVN component.
     19  (format *debug-io* "~&Attemping to locate jvm binary artifacts for JNA...~&")
    1520  (handler-case
    16       (unless (jss:find-java-class "com.sun.jna.Native")
    17         (unless (java:add-to-classpath (abcl-asdf:resolve "net.java.dev.jna:jna:3.4.0"))
    18           (java:add-to-classpath "http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar")))
     21      (jss:find-java-class "com.sun.jna.Native")
     22    (java:java-exception (e)
     23      (unless
     24          (java:add-to-classpath (abcl-asdf:resolve "net.java.dev.jna:jna:3.4.0"))
     25        (unless
     26            (java:add-to-classpath #p"http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.4.0/jna-3.4.0.jar")
     27          (error "Failed to load jna-3.4.0.jar from the network via URI."))
     28        (error "Failed to load jna.jar via ABCL-ASDF.")))
    1929    (t (e)
    20       (error "Failed to resolve 'jna.jar' because~&~A." e))))
     30      (error "Failed to resolve 'jna.jar' because~&~A.~&" e))))
    2131
    2232                         
Note: See TracChangeset for help on using the changeset viewer.