Ignore:
Timestamp:
08/01/11 21:34:26 (12 years ago)
Author:
Mark Evenson
Message:

Refactor ASDF extensions from JSS into ABCL-ASDF.

The JAR-FILE, JAR-DIRECTORY, and CLASS-FILE-DIRECTORY ASDF extensions
are now part of the ABCL-ASDF contrib as we aim to centralize all such
things in one place. *ADDED-TO-CLASSPATH* is now part of the
ABCL-ASDF package as well.

There is currently a (mostly) recursive relationship between JSS and
ABCL-ASDF, as each (mostly) requires the other for operation.
JSS:ENSURE-COMPATIBILITY will ensure that JSS continues to understand
the refactored extensions.

File:
1 moved

Legend:

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

    r13429 r13430  
     1(in-package :abcl-asdf)
     2
     3(defvar *added-to-classpath* nil)
     4
     5(defvar *inhibit-add-to-classpath* nil)
     6
     7(defun add-directory-jars-to-class-path (directory recursive-p)
     8  (loop :for jar :in (if recursive-p
     9                         (all-jars-below directory)
     10                         (directory (merge-pathnames "*.jar" directory)))
     11     :do (java:add-to-classpath jar)))
     12
     13(defun all-jars-below (directory)
     14  (loop :with q = (system:list-directory directory)
     15     :while q :for top = (pop q)
     16     :if (null (pathname-name top))
     17       :do (setq q (append q (all-jars-below top)))
     18     :if (equal (pathname-type top) "jar")
     19       :collect top))
     20
     21(defun need-to-add-directory-jar? (directory recursive-p)
     22  (loop :for jar :in (if recursive-p
     23                         (all-jars-below directory)
     24                         (directory (merge-pathnames "*.jar" directory)))
     25     :doing (if (not (member (namestring (truename jar)) *added-to-classpath* :test 'equal))
     26                (return-from need-to-add-directory-jar? t)))
     27  nil)
     28
    129(in-package :asdf)
    230
     
    432
    533(defmethod perform ((operation compile-op) (c jar-directory))
    6   (unless jss:*inhibit-add-to-classpath*
    7     (jss:add-directory-jars-to-class-path (truename (component-pathname c)) t)))
     34  (unless abcl-asdf:*inhibit-add-to-classpath*
     35    (abcl-asdf:add-directory-jars-to-class-path (truename (component-pathname c)) t)))
    836
    937(defmethod perform ((operation load-op) (c jar-directory))
    10   (unless jss:*inhibit-add-to-classpath*
    11     (jss:add-directory-jars-to-class-path (truename (component-pathname c)) t)))
     38  (unless abcl-asdf:*inhibit-add-to-classpath*
     39    (abcl-asdf:add-directory-jars-to-class-path (truename (component-pathname c)) t)))
    1240
    1341(defmethod operation-done-p ((operation load-op) (c jar-directory))
    14   (or jss:*inhibit-add-to-classpath*
    15     (not (jss:need-to-add-directory-jar? (component-pathname c) t))))
     42  (or abcl-asdf:*inhibit-add-to-classpath*
     43      (not (abcl-asdf:need-to-add-directory-jar? (component-pathname c) t))))
    1644
    1745(defmethod operation-done-p ((operation compile-op) (c jar-directory))
     
    2048(defclass jar-file (static-file) ())
    2149
     50(defmethod source-file-type ((c jar-file) (s module)) "jar")
     51
    2252(defmethod perform ((operation compile-op) (c jar-file))
    23   (jss:add-to-classpath (component-pathname c)))
     53  (java:add-to-classpath (component-pathname c)))
    2454
    2555(defmethod perform ((operation load-op) (c jar-file))
    26   (or jss:*inhibit-add-to-classpath*
    27       (jss:add-to-classpath (component-pathname c))))
     56  (or abcl-asdf:*inhibit-add-to-classpath*
     57      (java:add-to-classpath (component-pathname c))))
    2858
    2959(defmethod operation-done-p ((operation load-op) (c jar-file))
    30   (or jss:*inhibit-add-to-classpath*
    31       (member (namestring (truename (component-pathname c))) jss:*added-to-classpath* :test 'equal)))
     60  (or abcl-asdf:*inhibit-add-to-classpath*
     61      (member (namestring (truename (component-pathname c)))
     62              abcl-asdf:*added-to-classpath* :test 'equal)))
    3263
    3364(defmethod operation-done-p ((operation compile-op) (c jar-file))
     
    3768
    3869(defmethod perform ((operation compile-op) (c class-file-directory))
    39   (jss:add-to-classpath (component-pathname c)))
     70  (java:add-to-classpath (component-pathname c)))
    4071
    4172(defmethod perform ((operation load-op) (c class-file-directory))
    42   (jss:add-to-classpath (component-pathname c)))
    43 
    44 (defmethod source-file-type ((c jar-file) (s module)) "jar")
     73  (java:add-to-classpath (component-pathname c)))
    4574
    4675
    4776
    4877
     78
Note: See TracChangeset for help on using the changeset viewer.