Changeset 13344
- Timestamp:
- 06/17/11 11:57:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/contrib/asdf-jar/asdf-jar.lisp
r13337 r13344 1 (defpackage :asdf-jar1 (defpackage #:asdf-jar 2 2 (:use :cl) 3 3 (:export #:package)) 4 4 5 5 (in-package :asdf-jar) 6 7 6 8 7 (defvar *systems*) … … 28 27 (format verbose "~&Packaging ASDF definition of ~A~&as ~A." system package-jar)) 29 28 (setf *systems* nil) 29 (when verbose 30 (format verbose "~&Forcing recursive compilation of ~A." package-jar)) 30 31 (asdf:compile-system system :force t) 31 (let* ((dir (asdf:component-pathname system)) 32 (wild-contents (merge-pathnames "**/*" dir)) 33 (contents (directory wild-contents)) 34 (topdir (truename (merge-pathnames "../" dir)))) 35 (when verbose 36 (format verbose "~&Packaging contents in ~A." package-jar)) 37 (dolist (system (append (list system) *systems*)) 38 (let ((base (slot-value system 'asdf:absolute-pathname)) 39 (name (slot-value system 'asdf:name)) 40 (asdf (slot-value system source-file))) 41 (setf (gethash asdf mapping) (relative-path base name asdf)))) 32 (when verbose 33 (format verbose "~&Packaging contents in ~A." package-jar)) 34 (dolist (system (append (list system) *systems*)) 35 (let ((base (slot-value system 'asdf::absolute-pathname)) 36 (name (slot-value system 'asdf::name)) 37 (asdf (slot-value system 'asdf::source-file))) 38 (setf (gethash asdf mapping) (relative-path base name asdf)) 39 42 40 ;;; XXX iterate through the rest of the contents of the 43 41 ;;; system, adding appropiate entries 44 (system:zip package-jar mapping)))) 42 (let ((sources 43 (mapwalk (lambda (c) (typep c 'asdf::source-file)) 44 (lambda (c) (input-files c ))))) 45 (loop :for source :in sources 46 :do (setf (gethash (pathname-namestring source) mapping) 47 (make-pathname :defaults source 48 :type "abcl")))))) 49 (system:zip package-jar mapping))) 50 51 ;;; This more Map than Walk at this point ... 52 (defun mapwalk (system test-if callable) 53 (declare (type system asdf:system)) 54 (let ((components 55 (loop 56 :for component :being :each :hash-value 57 :of (slot-value system 'asdf::components-by-name) 58 :when (funcall test-if component) 59 :collect component))) 60 (loop :for component :in components 61 :collecting (apply callable component)))) 45 62 46 63 (defun relative-path (base dir file)
Note: See TracChangeset
for help on using the changeset viewer.