Changeset 14188


Ignore:
Timestamp:
10/12/12 12:35:37 (8 years ago)
Author:
Mark Evenson
Message:

jna.jar: Try harder by introspecting the classpath.

File:
1 edited

Legend:

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

    r14187 r14188  
    99(defmethod asdf:perform :after ((o asdf:load-op) (c (eql (asdf:find-system :jna))))
    1010  ;; Theoretically this should be the same thing as the MVN component.
    11   (java:add-to-classpath (abcl-asdf:resolve "net.java.dev.jna:jna:3.4.0")))
     11  (handler-case
     12      (unless
     13          (flet ((match-jna-jar (p)
     14                   "Match `jna.jar`,`jna-3.0.9.jar`, or `jna-3.4.0.jar`."
     15                   (and (pathnamep p)
     16                        (equal (pathname-type p) "jar")
     17                        (java:jstatic "matches"
     18                                      "java.util.regex.Pattern"
     19                                      "jna(-[0-9]\\.[0-9]\\.[0-9](-.+)?)?"
     20                                      (pathname-name p))
     21                        p)))
     22            (dolist (loader (java:dump-classpath))
     23              (let ((jna-jar (some #'match-jna-jar loader)))
     24                (when jna-jar
     25                  (return abcl-jar)))))
     26        (java:add-to-classpath (abcl-asdf:resolve
     27                                "net.java.dev.jna:jna:3.4.0")))
     28    (t (e) (error "Failed to resolve 'jna.jar' because~&~A." e))))
    1229
    1330                         
Note: See TracChangeset for help on using the changeset viewer.