Ignore:
Timestamp:
11/09/12 14:44:33 (8 years ago)
Author:
Mark Evenson
Message:

abcl-asdf: Enable bypassing of loading from network if a given class already exists.

An ASDF:MVN component can now optionally specify a CLASSNAME that if
able to be found in the current jvm process, inhbits further loading
from the network.

An ASDF:MVN component may also optionally specify an ALTERNATE-URI
that will be added to the current jvm classpath if Maven cannot be
invoked. Most jvm implementations won't access such jar archives from
the network by default, so this is an intermediate step before
actually writing the code to download the jar to the local filesystem
to then be added.

Refresh documentation in README.markdown.

File:
1 edited

Legend:

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

    r14225 r14236  
    11;;;; -*- Mode: LISP -*-
    22
    3 ;;;; Need to have jna.jar present for CFFI to have a chance of working.
     3;;;; Need to have jna.jar present for CFFI to work.
    44(asdf:defsystem :jna
    55    :version "3.5.1"
    66    :defsystem-depends-on (jss abcl-asdf)
    77;; FIXME: always seems to be resolving the LATEST maven artifact.
    8     :components ((:mvn "net.java.dev.jna/jna/3.5.1")))
     8    :components ((:mvn "net.java.dev.jna/jna/3.5.1"
     9                  :alternate-uri "http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.5.1/jna-3.5.1.jar"
     10                  :classname "com.sun.jna.Native")))
    911
    1012(in-package :asdf)
     
    1315    (provide :jna)))
    1416
    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))))
    18   ;; Theoretically this should be the same thing as the MVN component.
    19   (format *debug-io* "~&Attemping to locate jvm binary artifacts for JNA...~&")
    20   (handler-case
    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.5.1"))
    25         (unless
    26             ;; Might want to download to local filesystem, then place in classpath
    27             (java:add-to-classpath #p"http://repo1.maven.org/maven2/net/java/dev/jna/jna/3.5.1/jna-3.5.1.jar")
    28           (error "Failed to load jna-3.5.0.jar from the network via URI."))
    29         (error "Failed to load jna.jar via ABCL-ASDF.")))
    30     (t (e)
    31       (error "Failed to resolve 'jna.jar' because~&~A.~&" e))))
    32 
    3317                         
Note: See TracChangeset for help on using the changeset viewer.